Documentation
¶
Index ¶
- Constants
- func New(host, apiKey string, model Model) providers.Client
- func NewCompatible(host, apiKey string, model Model) providers.Clientdeprecated
- type Embedding
- func (c Embedding) Completion(ctx context.Context, request providers.Request) providers.Response
- func (c Embedding) CompletionNonStreaming(ctx context.Context, request providers.Request) (_ string, retErr error)
- func (c Embedding) ContextWindow() int64
- func (c Embedding) StructuredPredict(ctx context.Context, request providers.Request, model any) (retErr error)
- func (o *Embedding) Vectorization(ctx context.Context, content string) ([]float64, error)
- type Model
- type Reasoning
- type ToolDefinePrompt
- type ToolPrompt
- type ToolUse
- type ToolUseResult
Constants ¶
View Source
const ( DEFAULT_STRUCTURED_PREDICT_PROMPT = `<background> You are a intelligent data processing engine. Your core objective is to analyze the user's request, perform reasoning and computation using logic and knowledge, and ultimately deliver the processed result in the form of a **perfectly formatted JSON object that strictly complies with the provided JSON Schema**. </background> <processing_instructions> 1. **Analyze Thoroughly:** Carefully analyze the user_request to understand the user's underlying intent and all specific requirements. 2. **Reason & Execute:** Perform all necessary reasoning, information extraction, data calculation, or logical judgment based on the request. This is your internal processing stage. 3. **Structure the Result:** Map and populate your final result meticulously into the structure defined by the response_schema. Ensure all field names, data types, nested relationships, and constraints (e.g., required, enum) are 100% compliant. 4. **Make Reasonable Assumptions:** For any fields required by the response_schema not explicitly specified in the request, make the most reasonable assumptions based on context and common sense (e.g., generating IDs, timestamps, or status labels). </processing_instructions> <output_instructions> - **Your final output MUST be EXCLUSIVELY a single JSON object.** - **You are ABSOLUTELY FORBIDDEN from adding any content outside this JSON object, including:** - Explanatory text, comments (//, /* */), apologies, or greetings. - Markdown code block fences (e.g., ` + "```json, ```" + `). - Your internal reasoning or thought process (e.g., [THOUGHT]...). - The JSON object MUST be directly parsable by standard libraries (e.g., JSON.parse()) without any need for preprocessing or cleanup. </output_instructions> <structural_example> ### Input [USER_REQUEST] <The user's natural language request> [RESPONSE_SCHEMA] <The JSON Schema defining the structure your output MUST adhere to> ### Output One and only one JSON object compliant with the response_schema. </structural_example> **Begin processing the following request.** [USER_REQUEST] {insert_user_request_here} [RESPONSE_SCHEMA] {insert_json_schema_here} ` DEFAULT_TOOL_USE_PROMPT = `` /* 5537-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func NewCompatible
deprecated
Types ¶
type Embedding ¶
type Embedding struct {
// contains filtered or unexported fields
}
func NewEmbedding ¶
func (Embedding) Completion ¶
func (Embedding) CompletionNonStreaming ¶
func (Embedding) ContextWindow ¶
func (c Embedding) ContextWindow() int64
func (Embedding) StructuredPredict ¶
type ToolDefinePrompt ¶
type ToolDefinePrompt struct {
Tools []ToolPrompt `xml:"tools"`
}
type ToolPrompt ¶
Click to show internal directories.
Click to hide internal directories.