Class AnthropicModelProvider

java.lang.Object
io.agentscope.extensions.model.anthropic.AnthropicModelProvider
All Implemented Interfaces:
io.agentscope.core.model.spi.ModelProvider

public final class AnthropicModelProvider extends Object implements io.agentscope.core.model.spi.ModelProvider
Anthropic provider registered through ServiceLoader.

Credentials come from the context's standard apiKey field or the "authToken" context option (a bearer token for Anthropic-compatible gateways; the two are mutually exclusive). When neither is set, the ANTHROPIC_API_KEY environment variable is used, then ANTHROPIC_AUTH_TOKEN.

  • Constructor Details

    • AnthropicModelProvider

      public AnthropicModelProvider()
  • Method Details

    • providerId

      public String providerId()
      Specified by:
      providerId in interface io.agentscope.core.model.spi.ModelProvider
    • supports

      public boolean supports(String modelId)
      Specified by:
      supports in interface io.agentscope.core.model.spi.ModelProvider
    • create

      public io.agentscope.core.model.Model create(String modelId)
      Specified by:
      create in interface io.agentscope.core.model.spi.ModelProvider
    • create

      public io.agentscope.core.model.Model create(String modelId, io.agentscope.core.model.ModelCreationContext context)
      Specified by:
      create in interface io.agentscope.core.model.spi.ModelProvider