Documentation
¶
Index ¶
- func NeedPassword(backend string) bool
- func NewMemoryService() *memoryService
- type Configuration
- type IAI
- type IAIConfig
- type OpenAIClient
- func (c *OpenAIClient) ClearHistory(ctx context.Context) error
- func (OpenAIClient) Close()
- func (c *OpenAIClient) Configure(config IAIConfig) error
- func (c *OpenAIClient) GetCompletion(ctx context.Context, contents ...any) (string, error)
- func (c *OpenAIClient) GetCompletionWithTools(ctx context.Context, contents ...any) ([]openai.ToolCall, string, error)
- func (c *OpenAIClient) GetHistory(ctx context.Context) []openai.ChatCompletionMessage
- func (c *OpenAIClient) GetName() string
- func (c *OpenAIClient) GetStreamCompletion(ctx context.Context, contents ...any) (*openai.ChatCompletionStream, error)
- func (c *OpenAIClient) GetStreamCompletionWithTools(ctx context.Context, contents ...any) (*openai.ChatCompletionStream, error)
- func (c *OpenAIClient) SaveAIHistory(ctx context.Context, contents string)
- func (c *OpenAIClient) SetTools(tools []openai.Tool)
- type OpenAIHeaderTransport
- type Provider
- func (p *Provider) GetBaseURL() string
- func (p *Provider) GetCompartmentId() string
- func (p *Provider) GetCustomHeaders() []http.Header
- func (p *Provider) GetEndpointName() string
- func (p *Provider) GetEngine() string
- func (p *Provider) GetMaxHistory() int32
- func (p *Provider) GetMaxTokens() int
- func (p *Provider) GetModel() string
- func (p *Provider) GetOrganizationId() string
- func (p *Provider) GetPassword() string
- func (p *Provider) GetProviderId() string
- func (p *Provider) GetProviderRegion() string
- func (p *Provider) GetProxyEndpoint() string
- func (p *Provider) GetTemperature() float32
- func (p *Provider) GetThink() bool
- func (p *Provider) GetTopK() int32
- func (p *Provider) GetTopP() float32
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NeedPassword ¶
Types ¶
type Configuration ¶
type IAI ¶
type IAI interface {
Configure(config IAIConfig) error
GetCompletion(ctx context.Context, contents ...any) (string, error)
GetCompletionWithTools(ctx context.Context, contents ...any) ([]openai.ToolCall, string, error)
GetStreamCompletion(ctx context.Context, contents ...any) (*openai.ChatCompletionStream, error)
GetStreamCompletionWithTools(ctx context.Context, contents ...any) (*openai.ChatCompletionStream, error)
GetName() string
Close()
SetTools(tools []openai.Tool)
SaveAIHistory(ctx context.Context, content string)
GetHistory(ctx context.Context) []openai.ChatCompletionMessage
ClearHistory(ctx context.Context) error
}
type IAIConfig ¶
type IAIConfig interface {
GetPassword() string
GetModel() string
GetBaseURL() string
GetProxyEndpoint() string
GetEndpointName() string
GetEngine() string
GetTemperature() float32
GetProviderRegion() string
GetTopP() float32
GetTopK() int32
GetMaxTokens() int
GetMaxHistory() int32
GetProviderId() string
GetCompartmentId() string
GetOrganizationId() string
GetCustomHeaders() []http.Header
GetThink() bool
}
type OpenAIClient ¶
type OpenAIClient struct {
// contains filtered or unexported fields
}
func (*OpenAIClient) ClearHistory ¶
func (c *OpenAIClient) ClearHistory(ctx context.Context) error
func (*OpenAIClient) Configure ¶
func (c *OpenAIClient) Configure(config IAIConfig) error
func (*OpenAIClient) GetCompletion ¶
func (*OpenAIClient) GetCompletionWithTools ¶
func (*OpenAIClient) GetHistory ¶
func (c *OpenAIClient) GetHistory(ctx context.Context) []openai.ChatCompletionMessage
func (*OpenAIClient) GetName ¶
func (c *OpenAIClient) GetName() string
func (*OpenAIClient) GetStreamCompletion ¶
func (c *OpenAIClient) GetStreamCompletion(ctx context.Context, contents ...any) (*openai.ChatCompletionStream, error)
func (*OpenAIClient) GetStreamCompletionWithTools ¶
func (c *OpenAIClient) GetStreamCompletionWithTools(ctx context.Context, contents ...any) (*openai.ChatCompletionStream, error)
func (*OpenAIClient) SaveAIHistory ¶
func (c *OpenAIClient) SaveAIHistory(ctx context.Context, contents string)
func (*OpenAIClient) SetTools ¶
func (c *OpenAIClient) SetTools(tools []openai.Tool)
type OpenAIHeaderTransport ¶
type OpenAIHeaderTransport struct {
Origin http.RoundTripper
Headers []http.Header
}
OpenAIHeaderTransport is an http.RoundTripper that adds the given headers to each request.
type Provider ¶
type Provider struct {
Name string
Model string
Password string
BaseURL string
ProxyEndpoint string
ProxyPort string
EndpointName string
Engine string
Temperature float32
ProviderRegion string
ProviderId string
CompartmentId string
TopP float32
TopK int32
MaxHistory int32
MaxTokens int
OrganizationId string
CustomHeaders []http.Header
Think bool
}
func (*Provider) GetBaseURL ¶
func (*Provider) GetCompartmentId ¶
func (*Provider) GetCustomHeaders ¶
func (*Provider) GetEndpointName ¶
func (*Provider) GetMaxHistory ¶
func (*Provider) GetMaxTokens ¶
func (*Provider) GetOrganizationId ¶
func (*Provider) GetPassword ¶
func (*Provider) GetProviderId ¶
func (*Provider) GetProviderRegion ¶
func (*Provider) GetProxyEndpoint ¶
func (*Provider) GetTemperature ¶
Click to show internal directories.
Click to hide internal directories.