Documentation
¶
Index ¶
Constants ¶
View Source
const (
// DefaultBaseURL is the default OpenAI API endpoint
DefaultBaseURL = "https://api.openai.com/v1"
)
Variables ¶
This section is empty.
Functions ¶
func NewModel ¶
NewModel returns github.com/sjzsdu/adk-go-cn/model.LLM, backed by the OpenAI API.
It uses the provided modelName and configuration to initialize the underlying HTTP client for OpenAI API calls.
An error is returned if the configuration is invalid.
Types ¶
type Config ¶
type Config struct {
// APIKey is the OpenAI API key. If empty, it will be read from OPENAI_API_KEY environment variable.
APIKey string
// BaseURL is the OpenAI API base URL. If empty, it will use DefaultBaseURL.
BaseURL string
// Organization is the OpenAI organization ID.
Organization string
// HTTPClient is the HTTP client to use. If nil, http.DefaultClient will be used.
HTTPClient *http.Client
}
Config holds the configuration for OpenAI model initialization.
Click to show internal directories.
Click to hide internal directories.