Documentation
¶
Index ¶
- Constants
- Variables
- func NewOpenAIIntegrationCreator(deps domain.IntegrationDeps) domain.IntegrationCreator
- type AgentChatParams
- type ChatCompletionParams
- type GenerateEmbeddingsParams
- type ImageGenerationParams
- type OpenAICredential
- type OpenAIIntegration
- func (i *OpenAIIntegration) AgentChat(ctx context.Context, params domain.IntegrationInput, item domain.Item) (domain.Item, error)
- func (i *OpenAIIntegration) ChatCompletion(ctx context.Context, params domain.IntegrationInput, item domain.Item) (domain.Item, error)
- func (i *OpenAIIntegration) Execute(ctx context.Context, params domain.IntegrationInput) (domain.IntegrationOutput, error)
- func (i *OpenAIIntegration) GenerateEmbeddings(ctx context.Context, params domain.IntegrationInput, item domain.Item) (domain.Item, error)
- func (i *OpenAIIntegration) GenerateImage(ctx context.Context, params domain.IntegrationInput, item domain.Item) (domain.Item, error)
- func (i *OpenAIIntegration) GenerateWithConversation(ctx context.Context, req domain.GenerateRequest) (domain.ModelResponse, error)
- func (i *OpenAIIntegration) ListModels(ctx context.Context, params domain.IntegrationInput) (domain.IntegrationOutput, error)
- func (i *OpenAIIntegration) Peek(ctx context.Context, params domain.IntegrationPeekableType) (domain.PeekResult, error)
- func (i *OpenAIIntegration) PeekModels(ctx context.Context) (domain.PeekResult, error)
- func (i *OpenAIIntegration) SetClient(client *openai.Client)
- type OpenAIIntegrationCreator
- type OpenAIIntegrationDependencies
Constants ¶
View Source
const ( IntegrationActionType_Chat domain.IntegrationActionType = "chat" IntegrationActionType_GenerateImage domain.IntegrationActionType = "generate_image" IntegrationActionType_AgentChat domain.IntegrationActionType = "ai_agent_chat" // Added for agent LLM IntegrationActionType_GenerateEmbedding domain.IntegrationActionType = "generate_embeddings" )
View Source
const (
OpenAIIntegrationPeekable_Models domain.IntegrationPeekableType = "models"
)
Variables ¶
View Source
var (
Schema = schema
)
Functions ¶
func NewOpenAIIntegrationCreator ¶
func NewOpenAIIntegrationCreator(deps domain.IntegrationDeps) domain.IntegrationCreator
Types ¶
type AgentChatParams ¶
type AgentChatParams struct {
Model string `json:"model"`
Messages []openai.ChatCompletionMessage `json:"messages"`
Tools []openai.Tool `json:"tools,omitempty"`
SystemPrompt string `json:"system_prompt,omitempty"`
Temperature float32 `json:"temperature"`
MaxTokens int `json:"max_tokens"`
}
AgentChatParams represents parameters for AI agent chat requests
type ChatCompletionParams ¶
type ImageGenerationParams ¶
type OpenAICredential ¶
type OpenAICredential struct {
APIKey string `json:"api_key"`
}
type OpenAIIntegration ¶
type OpenAIIntegration struct {
// contains filtered or unexported fields
}
func NewOpenAIIntegration ¶
func NewOpenAIIntegration(ctx context.Context, deps OpenAIIntegrationDependencies) (*OpenAIIntegration, error)
func (*OpenAIIntegration) AgentChat ¶
func (i *OpenAIIntegration) AgentChat(ctx context.Context, params domain.IntegrationInput, item domain.Item) (domain.Item, error)
Add the AgentChat handler implementation
func (*OpenAIIntegration) ChatCompletion ¶
func (i *OpenAIIntegration) ChatCompletion(ctx context.Context, params domain.IntegrationInput, item domain.Item) (domain.Item, error)
func (*OpenAIIntegration) Execute ¶
func (i *OpenAIIntegration) Execute(ctx context.Context, params domain.IntegrationInput) (domain.IntegrationOutput, error)
func (*OpenAIIntegration) GenerateEmbeddings ¶
func (i *OpenAIIntegration) GenerateEmbeddings(ctx context.Context, params domain.IntegrationInput, item domain.Item) (domain.Item, error)
func (*OpenAIIntegration) GenerateImage ¶
func (i *OpenAIIntegration) GenerateImage(ctx context.Context, params domain.IntegrationInput, item domain.Item) (domain.Item, error)
func (*OpenAIIntegration) GenerateWithConversation ¶
func (i *OpenAIIntegration) GenerateWithConversation(ctx context.Context, req domain.GenerateRequest) (domain.ModelResponse, error)
GenerateWithConversation implements domain.IntegrationLLM interface
func (*OpenAIIntegration) ListModels ¶
func (i *OpenAIIntegration) ListModels(ctx context.Context, params domain.IntegrationInput) (domain.IntegrationOutput, error)
func (*OpenAIIntegration) Peek ¶
func (i *OpenAIIntegration) Peek(ctx context.Context, params domain.IntegrationPeekableType) (domain.PeekResult, error)
func (*OpenAIIntegration) PeekModels ¶
func (i *OpenAIIntegration) PeekModels(ctx context.Context) (domain.PeekResult, error)
func (*OpenAIIntegration) SetClient ¶
func (i *OpenAIIntegration) SetClient(client *openai.Client)
type OpenAIIntegrationCreator ¶
type OpenAIIntegrationCreator struct {
// contains filtered or unexported fields
}
func (*OpenAIIntegrationCreator) CreateIntegration ¶
func (c *OpenAIIntegrationCreator) CreateIntegration(ctx context.Context, p domain.CreateIntegrationParams) (domain.IntegrationExecutor, error)
type OpenAIIntegrationDependencies ¶
type OpenAIIntegrationDependencies struct {
CredentialID string
CredentialGetter domain.CredentialGetter[OpenAICredential]
ParameterBinder domain.IntegrationParameterBinder
WorkspaceID string
ExecutorStorageManager domain.ExecutorStorageManager
}
Click to show internal directories.
Click to hide internal directories.