Help us shape the future of Go! Take the 2026 Go Developer Survey

entity

package
v0.1.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 1 Imported by: 6

Documentation

Index

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 ExecuteParam struct {
	PromptKey    string         `json:"prompt_key"`
	Version      string         `json:"version,omitempty"`
	Label        string         `json:"label,omitempty"`
	VariableVals map[string]any `json:"variable_vals,omitempty"`
	Messages     []*Message     `json:"messages,omitempty"`
}

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 Function struct {
	Name        string  `json:"name"`
	Description *string `json:"description,omitempty"`
	Parameters  *string `json:"parameters,omitempty"`
}

func (*Function) DeepCopy

func (f *Function) DeepCopy() *Function

type FunctionCall added in v0.1.12

type FunctionCall struct {
	Name      string  `json:"name"`
	Arguments *string `json:"arguments,omitempty"`
}

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"`
}

func (*LLMConfig) DeepCopy

func (mc *LLMConfig) DeepCopy() *LLMConfig

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"`
}

func (*Message) DeepCopy

func (m *Message) DeepCopy() *Message

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"`
}

func (*Prompt) DeepCopy

func (p *Prompt) DeepCopy() *Prompt

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 Role

type Role string
const (
	RoleSystem      Role = "system"
	RoleUser        Role = "user"
	RoleAssistant   Role = "assistant"
	RoleTool        Role = "tool"
	RolePlaceholder Role = "placeholder"
)

type StreamReader added in v0.1.12

type StreamReader[T any] interface {
	Recv() (T, error)
}

type TemplateType

type TemplateType string
const (
	TemplateTypeNormal TemplateType = "normal"
	TemplateTypeJinja2 TemplateType = "jinja2"
)

type TokenUsage added in v0.1.12

type TokenUsage struct {
	InputTokens  int `json:"input_tokens"`
	OutputTokens int `json:"output_tokens"`
}

type Tool

type Tool struct {
	Type     ToolType  `json:"type"`
	Function *Function `json:"function,omitempty"`
}

func (*Tool) DeepCopy

func (t *Tool) DeepCopy() *Tool

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 ToolType

type ToolType string
const (
	ToolTypeFunction ToolType = "function"
)

type UploadFile added in v0.1.7

type UploadFile struct {
	TosKey     string
	Data       string
	UploadType UploadType
	TagKey     string
	Name       string
	FileType   string
	SpaceID    string
}

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"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL