Documentation
¶
Index ¶
- type CacheOption
- type Function
- type GetPromptOptions
- type GetPromptParam
- type LLMConfig
- type MPullPromptRequest
- type MPullPromptResponse
- type Message
- type OpenAPIClient
- type Option
- type Options
- type Prompt
- type PromptCache
- type PromptFormatOptions
- type PromptQuery
- type PromptResult
- type PromptResultData
- type PromptTemplate
- type Provider
- type Role
- type TemplateType
- type Tool
- type ToolCallConfig
- type ToolChoiceType
- type ToolType
- type VariableDef
- type VariableType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheOption ¶
type GetPromptOptions ¶
type GetPromptOptions struct {
}
type GetPromptParam ¶
type LLMConfig ¶
type LLMConfig struct {
Temperature *float64 `json:"temperature,omitempty"`
MaxTokens *int32 `json:"max_tokens,omitempty"`
TopK *int32 `json:"top_k,omitempty"`
TopP *float64 `json:"top_p,omitempty"`
FrequencyPenalty *float64 `json:"frequency_penalty,omitempty"`
PresencePenalty *float64 `json:"presence_penalty,omitempty"`
JSONMode *bool `json:"json_mode,omitempty"`
}
type MPullPromptRequest ¶
type MPullPromptRequest struct {
WorkSpaceID string `json:"workspace_id"`
Queries []PromptQuery `json:"queries"`
}
type MPullPromptResponse ¶
type MPullPromptResponse struct {
httpclient.BaseResponse
Data PromptResultData `json:"data"`
}
type OpenAPIClient ¶
type OpenAPIClient struct {
// contains filtered or unexported fields
}
func (*OpenAPIClient) MPullPrompt ¶
func (o *OpenAPIClient) MPullPrompt(ctx context.Context, req MPullPromptRequest) ([]*PromptResult, error)
type Option ¶
type Option func(*CacheOption)
type Prompt ¶
type Prompt struct {
WorkspaceID string `json:"workspace_id"`
PromptKey string `json:"prompt_key"`
Version string `json:"version"`
PromptTemplate *PromptTemplate `json:"prompt_template,omitempty"`
Tools []*Tool `json:"tools,omitempty"`
ToolCallConfig *ToolCallConfig `json:"tool_call_config,omitempty"`
LLMConfig *LLMConfig `json:"llm_config,omitempty"`
}
type PromptCache ¶
type PromptCache struct {
// contains filtered or unexported fields
}
func (*PromptCache) Get ¶
func (c *PromptCache) Get(promptKey, version string) (*entity.Prompt, bool)
func (*PromptCache) GetAllPromptQueries ¶
func (c *PromptCache) GetAllPromptQueries() []PromptQuery
GetAllPromptQueries gets all cached Prompt query conditions
func (*PromptCache) Set ¶
func (c *PromptCache) Set(promptKey, version string, prompt *entity.Prompt)
func (*PromptCache) Start ¶
func (c *PromptCache) Start()
func (*PromptCache) Stop ¶
func (c *PromptCache) Stop()
type PromptFormatOptions ¶
type PromptFormatOptions struct {
}
type PromptQuery ¶
type PromptResult ¶
type PromptResult struct {
Query PromptQuery `json:"query"`
Prompt *Prompt `json:"prompt,omitempty"`
}
type PromptResultData ¶
type PromptResultData struct {
Items []*PromptResult `json:"items,omitempty"`
}
type PromptTemplate ¶
type PromptTemplate struct {
TemplateType TemplateType `json:"template_type"`
Messages []*Message `json:"messages,omitempty"`
VariableDefs []*VariableDef `json:"variable_defs,omitempty"`
}
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func NewPromptProvider ¶
func (*Provider) GetPrompt ¶
func (p *Provider) GetPrompt(ctx context.Context, param GetPromptParam, options GetPromptOptions) (prompt *entity.Prompt, err error)
type TemplateType ¶
type TemplateType string
const ( TemplateTypeNormal TemplateType = "normal" TemplateTypeJinja2 TemplateType = "jinja2" )
type ToolCallConfig ¶
type ToolCallConfig struct {
ToolChoice ToolChoiceType `json:"tool_choice"`
}
type ToolChoiceType ¶
type ToolChoiceType string
const ( ToolChoiceTypeAuto ToolChoiceType = "auto" ToolChoiceTypeNone ToolChoiceType = "none" )
type VariableDef ¶
type VariableDef struct {
Key string `json:"key"`
Desc string `json:"desc"`
Type VariableType `json:"type"`
}
type VariableType ¶
type VariableType string
const ( VariableTypeString VariableType = "string" VariableTypePlaceholder VariableType = "placeholder" VariableTypeBoolean VariableType = "boolean" VariableTypeInteger VariableType = "integer" VariableTypeFloat VariableType = "float" VariableTypeObject VariableType = "object" VariableTypeArrayString VariableType = "array<string>" VariableTypeArrayBoolean VariableType = "array<boolean>" VariableTypeArrayInteger VariableType = "array<integer>" VariableTypeArrayFloat VariableType = "array<float>" VariableTypeArrayObject VariableType = "array<object>" )
Click to show internal directories.
Click to hide internal directories.