Documentation ¶
Index ¶
- func DumpDriverMap()
- func GetConfigWithDefault(ctx context.Context, pattern, def string) string
- func GetConfigWithNamePattern(ctx context.Context, name, namePattern, defPattern string) (v string)
- func GetDriverMap(ctx context.Context) *gmap.TreeMap
- func GoX(goroutineFunc func())
- func Int(v int) *int
- func Int64(v int64) *int64
- func Int64Value(v *int64) int64
- func IntValue(v *int) int
- func LogError(err error)
- func Register(name string, driver Driver)
- func String(v string) *string
- func StringNotEmpty(v string) *string
- func StringValue(v *string) string
- func VarInt(v *gvar.Var) *int
- func VarInt64(v *gvar.Var) *int64
- func VarString(v *gvar.Var) *string
- type Choice
- type DefaultOutputStream
- type Driver
- type Input
- type JsonKeysOption
- func WithChoicesKey(choicesKey string) JsonKeysOption
- func WithChoicesMessageKey(choicesMessageKey string) JsonKeysOption
- func WithCodeKey(codeKey string) JsonKeysOption
- func WithCompletionKey(completionKey string) JsonKeysOption
- func WithEvent(event string) JsonKeysOption
- func WithEventId(id string) JsonKeysOption
- func WithIdKey(idKey string) JsonKeysOption
- func WithMessageKey(messageKey string) JsonKeysOption
- func WithPromptKey(promptKey string) JsonKeysOption
- func WithTotalKey(totalKey string) JsonKeysOption
- func WithUsageKey(usageKey string) JsonKeysOption
- type Message
- type MessageOption
- type Output
- type OutputEvent
- type OutputStream
- type Tool
- type ToolCall
- type ToolCallFunction
- type ToolFunction
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpDriverMap ¶
func DumpDriverMap()
func GetConfigWithDefault ¶
func Int64Value ¶
func StringNotEmpty ¶
func StringValue ¶
Types ¶
type DefaultOutputStream ¶
type DefaultOutputStream struct {
// contains filtered or unexported fields
}
func NewDefaultOutputStream ¶
func NewDefaultOutputStream() *DefaultOutputStream
func (*DefaultOutputStream) Close ¶
func (s *DefaultOutputStream) Close(err error)
func (*DefaultOutputStream) Drain ¶
func (s *DefaultOutputStream) Drain()
func (*DefaultOutputStream) Err ¶
func (s *DefaultOutputStream) Err() (err error)
func (*DefaultOutputStream) Event ¶
func (s *DefaultOutputStream) Event() <-chan OutputEvent
func (*DefaultOutputStream) Push ¶
func (s *DefaultOutputStream) Push(event OutputEvent)
type Driver ¶
type JsonKeysOption ¶
type JsonKeysOption func(jsonKeysOptional)
func WithChoicesKey ¶
func WithChoicesKey(choicesKey string) JsonKeysOption
func WithChoicesMessageKey ¶
func WithChoicesMessageKey(choicesMessageKey string) JsonKeysOption
func WithCodeKey ¶
func WithCodeKey(codeKey string) JsonKeysOption
func WithCompletionKey ¶
func WithCompletionKey(completionKey string) JsonKeysOption
func WithEvent ¶
func WithEvent(event string) JsonKeysOption
func WithEventId ¶
func WithEventId(id string) JsonKeysOption
func WithIdKey ¶
func WithIdKey(idKey string) JsonKeysOption
func WithMessageKey ¶
func WithMessageKey(messageKey string) JsonKeysOption
func WithPromptKey ¶
func WithPromptKey(promptKey string) JsonKeysOption
func WithTotalKey ¶
func WithTotalKey(totalKey string) JsonKeysOption
func WithUsageKey ¶
func WithUsageKey(usageKey string) JsonKeysOption
type Message ¶
type Message interface { GetRole() *string GetContent() *string GetToolCalls() []ToolCall GetToolCallId() *string GetName() *string }
func NewMessage ¶
func NewMessage(role, content *string, options ...MessageOption) Message
type MessageOption ¶
type MessageOption func(*message)
func WithName ¶
func WithName(name *string) MessageOption
func WithToolCallId ¶
func WithToolCallId(toolCallId *string) MessageOption
func WithToolCalls ¶
func WithToolCalls(toolCalls []ToolCall) MessageOption
type Output ¶
type Output interface { Code() *string Message() *string GetId() *string GetChoices() []Choice GetUsage() Usage }
func NewJsonOutput ¶
func NewJsonOutput(json *gjson.Json, options ...JsonKeysOption) Output
func ParseJsonOutput ¶
func ParseJsonOutput(jsonString string, options ...JsonKeysOption) (Output, error)
type OutputEvent ¶
type OutputEvent interface { EventId() *string Event() *string GetId() *string GetChoices() []Choice GetUsage() Usage }
func NewJsonOutputEvent ¶
func NewJsonOutputEvent(json *gjson.Json, options ...JsonKeysOption) OutputEvent
func ParseJsonOutputEvent ¶
func ParseJsonOutputEvent(event *gclientx.Event, options ...JsonKeysOption) (OutputEvent, error)
type OutputStream ¶
type OutputStream interface { Event() <-chan OutputEvent Err() error Drain() }
type Tool ¶
type Tool interface { GetType() *string GetFunction() ToolFunction }
func NewTool ¶
func NewTool(tType *string, function ToolFunction) Tool
type ToolCall ¶
type ToolCall interface { GetId() *string GetType() *string GetFunction() ToolCallFunction GetIndex() *int }
func NewToolCall ¶
func NewToolCall(id, tType *string, function ToolCallFunction, index *int) ToolCall
type ToolCallFunction ¶
func NewToolCallFunction ¶
func NewToolCallFunction(name, arguments *string) ToolCallFunction
type ToolFunction ¶
type ToolFunction interface { GetName() *string GetDescription() *string GetParameters() map[string]interface{} }
func NewToolFunction ¶
func NewToolFunction(name, description *string, parameters map[string]interface{}) ToolFunction
Source Files ¶
Click to show internal directories.
Click to hide internal directories.