Documentation
¶
Index ¶
- type APIError
- type AuditTimestamp
- type ChatCompletion
- type Choice
- type Client
- func (client *Client) GenerateObject(ctx context.Context, params GenerateObjectParams, target any) (TextResult, error)
- func (client *Client) GenerateText(ctx context.Context, params GenerateTextParams) (TextResult, error)
- func (client *Client) StreamText(ctx context.Context, params GenerateTextParams) (*TextStream, error)
- type FunctionCall
- type FunctionDefinition
- type GenerateObjectParams
- type GenerateTextParams
- type GovernanceMetadata
- type Message
- type ObjectResult
- type Option
- type StreamEvent
- type StreamIterator
- type TextResult
- type TextStream
- type ToolCall
- type ToolDefinition
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type AuditTimestamp ¶
type ChatCompletion ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GenerateObject ¶
func (client *Client) GenerateObject( ctx context.Context, params GenerateObjectParams, target any, ) (TextResult, error)
func (*Client) GenerateText ¶
func (client *Client) GenerateText( ctx context.Context, params GenerateTextParams, ) (TextResult, error)
func (*Client) StreamText ¶
func (client *Client) StreamText( ctx context.Context, params GenerateTextParams, ) (*TextStream, error)
type FunctionCall ¶
type FunctionDefinition ¶
type GenerateObjectParams ¶
type GenerateObjectParams struct {
GenerateTextParams
Schema map[string]any
SchemaName string
SchemaDescription string
}
type GenerateTextParams ¶
type GovernanceMetadata ¶
type GovernanceMetadata struct {
RunID string `json:"run_id,omitempty"`
Upstream string `json:"upstream,omitempty"`
BYOK string `json:"byok,omitempty"`
Region string `json:"region,omitempty"`
Route string `json:"route,omitempty"`
PolicyDecision string `json:"policy_decision,omitempty"`
EvidenceHash string `json:"evidence_hash,omitempty"`
EstimatedCost *float64 `json:"estimated_cost,omitempty"`
}
type ObjectResult ¶
type ObjectResult[T any] struct { Object T TextResult }
func GenerateObject ¶
func GenerateObject[T any]( ctx context.Context, client *Client, params GenerateObjectParams, ) (ObjectResult[T], error)
type StreamEvent ¶
type StreamEvent struct {
Type string
Text string
ToolCall *ToolCall
Usage *Usage
FinishReason string
Octoryn GovernanceMetadata
Provider json.RawMessage
Err error
}
type StreamIterator ¶
type StreamIterator struct {
// contains filtered or unexported fields
}
func (*StreamIterator) Err ¶
func (iterator *StreamIterator) Err() error
func (*StreamIterator) Event ¶
func (iterator *StreamIterator) Event() StreamEvent
type TextResult ¶
type TextResult struct {
Text string
ToolCalls []ToolCall
FinishReason string
Usage *Usage
Octoryn GovernanceMetadata
Response ChatCompletion
}
type TextStream ¶
type TextStream struct {
// contains filtered or unexported fields
}
func (*TextStream) Iterator ¶
func (stream *TextStream) Iterator() *StreamIterator
func (*TextStream) Result ¶
func (stream *TextStream) Result(ctx context.Context) (TextResult, error)
type ToolCall ¶
type ToolCall struct {
ID string `json:"id"`
Type string `json:"type"`
Function FunctionCall `json:"function"`
}
func (ToolCall) DecodeInput ¶
type ToolDefinition ¶
type ToolDefinition struct {
Type string `json:"type"`
Function FunctionDefinition `json:"function"`
}
Click to show internal directories.
Click to hide internal directories.