Documentation
¶
Index ¶
- type ContentPart
- type ContentType
- type ExecuteParam
- type ExecuteResult
- type Function
- type FunctionCall
- type LLMConfig
- type Message
- type Prompt
- type PromptTemplate
- type Role
- type StreamReader
- type TemplateType
- type TokenUsage
- type Tool
- type ToolCall
- type ToolCallConfig
- type ToolChoiceType
- type ToolType
- type UploadFile
- type UploadSpan
- type UploadType
- type VariableDef
- type VariableType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentPart ¶ added in v0.1.10
type ContentPart struct {
Type ContentType `json:"type"`
Text *string `json:"text,omitempty"`
ImageURL *string `json:"image_url,omitempty"`
Base64Data *string `json:"base64_data,omitempty"`
}
func (*ContentPart) DeepCopy ¶ added in v0.1.10
func (cp *ContentPart) DeepCopy() *ContentPart
type ContentType ¶ added in v0.1.10
type ContentType string
const ( ContentTypeText ContentType = "text" ContentTypeImageURL ContentType = "image_url" ContentTypeBase64Data ContentType = "base64_data" ContentTypeMultiPartVariable ContentType = "multi_part_variable" )
type ExecuteParam ¶ added in v0.1.12
type ExecuteResult ¶ added in v0.1.12
type ExecuteResult struct {
Message *Message `json:"message,omitempty"`
FinishReason *string `json:"finish_reason,omitempty"`
Usage *TokenUsage `json:"usage,omitempty"`
}
type Function ¶
type FunctionCall ¶ added in v0.1.12
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 Message ¶
type Message struct {
Role Role `json:"role"`
ReasoningContent *string `json:"reasoning_content,omitempty"`
Content *string `json:"content,omitempty"`
Parts []*ContentPart `json:"parts,omitempty"`
ToolCallID *string `json:"tool_call_id,omitempty"`
ToolCalls []*ToolCall `json:"tool_calls,omitempty"`
}
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 PromptTemplate ¶
type PromptTemplate struct {
TemplateType TemplateType `json:"template_type"`
Messages []*Message `json:"messages,omitempty"`
VariableDefs []*VariableDef `json:"variable_defs,omitempty"`
}
func (*PromptTemplate) DeepCopy ¶
func (pt *PromptTemplate) DeepCopy() *PromptTemplate
type StreamReader ¶ added in v0.1.12
type TemplateType ¶
type TemplateType string
const ( TemplateTypeNormal TemplateType = "normal" TemplateTypeJinja2 TemplateType = "jinja2" )
type TokenUsage ¶ added in v0.1.12
type ToolCall ¶ added in v0.1.12
type ToolCall struct {
Index int32 `json:"index"`
ID string `json:"id"`
Type ToolType `json:"type"`
FunctionCall *FunctionCall `json:"function_call,omitempty"`
}
type ToolCallConfig ¶
type ToolCallConfig struct {
ToolChoice ToolChoiceType `json:"tool_choice"`
}
func (*ToolCallConfig) DeepCopy ¶
func (tc *ToolCallConfig) DeepCopy() *ToolCallConfig
type ToolChoiceType ¶
type ToolChoiceType string
const ( ToolChoiceTypeAuto ToolChoiceType = "auto" ToolChoiceTypeNone ToolChoiceType = "none" )
type UploadFile ¶ added in v0.1.7
type UploadSpan ¶ added in v0.1.7
type UploadSpan struct {
StartedATMicros int64 `json:"started_at_micros"` // start time in microseconds
LogID string `json:"log_id"` // the custom log id, identify different query.
SpanID string `json:"span_id"`
ParentID string `json:"parent_id"`
TraceID string `json:"trace_id"`
DurationMicros int64 `json:"duration_micros"` // duration in microseconds
ServiceName string `json:"service_name"` // the custom service name, identify different services.
WorkspaceID string `json:"workspace_id"` // cozeloop workspace id
SpanName string `json:"span_name"`
SpanType string `json:"span_type"`
StatusCode int32 `json:"status_code"`
Input string `json:"input"`
Output string `json:"output"`
ObjectStorage string `json:"object_storage"` // file object storage
SystemTagsString map[string]string `json:"system_tags_string"`
SystemTagsLong map[string]int64 `json:"system_tags_long"`
SystemTagsDouble map[string]float64 `json:"system_tags_double"`
TagsString map[string]string `json:"tags_string"`
TagsLong map[string]int64 `json:"tags_long"`
TagsDouble map[string]float64 `json:"tags_double"`
TagsBool map[string]bool `json:"tags_bool"`
}
type UploadType ¶ added in v0.1.7
type UploadType int64
const ( UploadTypeLong UploadType = 1 UploadTypeMultiModality UploadType = 2 )
type VariableDef ¶
type VariableDef struct {
Key string `json:"key"`
Desc string `json:"desc"`
Type VariableType `json:"type"`
}
func (*VariableDef) DeepCopy ¶
func (v *VariableDef) DeepCopy() *VariableDef
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>" VariableTypeMultiPart VariableType = "multi_part" )
Click to show internal directories.
Click to hide internal directories.