Provider
The provider layer defines model interfaces and concrete provider implementations.
Install provider interfaces only:
go get github.com/iamanishx/go-ai/providerOverview
Providers are modular, and the agent consumes models through the shared GenerateText and StreamText interface.
Available Providers
Amazon Bedrock
Native integration with AWS Bedrock supporting:
- Anthropic Claude
- Amazon Titan
- Meta Llama
- And moreā¦
Creating a Provider
import ( "github.com/iamanishx/go-ai/agent" "github.com/iamanishx/go-ai/provider/bedrock")
provider := bedrock.Create(bedrock.BedrockProviderSettings{ Region: "us-east-1",})Getting a Model
// Get a chat modelmodel := provider.Chat("anthropic.claude-3-sonnet-v1:0")
// Use with agenttoolAgent := agent.CreateToolLoopAgent(agent.ToolLoopAgentSettings{ Model: model, Tools: tools,})
_ = toolAgentAdding New Providers
To add a new provider, implement the ChatModel interface:
type ChatModel interface { GenerateText(ctx context.Context, opts GenerateTextOptions) (GenerateTextResult, error) StreamText(ctx context.Context, opts GenerateTextOptions) (<-chan StreamPart, error)}See the Bedrock provider for reference implementation.