Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 592 Bytes

README.md

File metadata and controls

24 lines (17 loc) · 592 Bytes

OpenAI agent-api provider

The OpenAI provider for agent-api


👷🏗️ The OpenAI provider is a work in progress and the API may change unexpectedly.

Usage

// Create an openai provider
provider := openai.NewProvider(&openai.ProviderOpts{})
provider.UseModel(ctx, gpt4o.GPT4_O)

// Create a new agent-api agent with openai
myAgent := agent.NewAgent(&agent.NewAgentConfig{
	Provider:     provider,
	SystemPrompt: "You are a helpful assistant.",
})

// Send a message to the agent
response, err := myAgent.Run(ctx, "Why is the sky blue?", agent.DefaultStopCondition)