Documentation
¶
Index ¶
- Variables
- func Identifiers(n parse.Node) ([]string, error)
- func PresetStopSequences(p *MatchedPreset) []string
- type ImageData
- type MatchedPreset
- type Message
- type PropertyType
- type Template
- type Tool
- type ToolCall
- type ToolCallFunction
- type ToolCallFunctionArguments
- type ToolFunction
- type ToolFunctionParameters
- type ToolPropertiesMap
- type ToolProperty
- type Tools
- type Values
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoMatchingPreset = errors.New("шаблон: нет пресета, достаточно близкого к chat_template модели")
Functions ¶
func PresetStopSequences ¶
func PresetStopSequences(p *MatchedPreset) []string
Types ¶
type MatchedPreset ¶
type MatchedPreset struct {
Name string `json:"name"`
IndexJinja string `json:"template"`
Bytes []byte `json:"-"`
Parameters *struct {
Stop []string `json:"stop"`
}
}
func Named ¶
func Named(modelChatTemplateJinja string) (*MatchedPreset, error)
func (*MatchedPreset) Reader ¶
func (t *MatchedPreset) Reader() io.Reader
type Message ¶
type Message struct {
Role string `json:"role"`
Content string `json:"content"`
Thinking string `json:"thinking,omitempty"`
Images []ImageData `json:"images,omitempty"`
ToolCalls []ToolCall `json:"tool_calls,omitempty"`
ToolName string `json:"tool_name,omitempty"`
ToolCallID string `json:"tool_call_id,omitempty"`
}
type PropertyType ¶
type PropertyType []string
func (PropertyType) MarshalJSON ¶
func (pt PropertyType) MarshalJSON() ([]byte, error)
func (PropertyType) String ¶
func (pt PropertyType) String() string
func (*PropertyType) UnmarshalJSON ¶
func (pt *PropertyType) UnmarshalJSON(data []byte) error
type Tool ¶
type Tool struct {
Type string `json:"type"`
Items any `json:"items,omitempty"`
Function ToolFunction `json:"function"`
}
type ToolCall ¶
type ToolCall struct {
ID string `json:"id,omitempty"`
Function ToolCallFunction `json:"function"`
}
type ToolCallFunction ¶
type ToolCallFunction struct {
Index int `json:"index"`
Name string `json:"name"`
Arguments ToolCallFunctionArguments `json:"arguments"`
}
type ToolCallFunctionArguments ¶
func (ToolCallFunctionArguments) MarshalJSON ¶
func (t ToolCallFunctionArguments) MarshalJSON() ([]byte, error)
func (ToolCallFunctionArguments) ToMap ¶
func (t ToolCallFunctionArguments) ToMap() map[string]any
func (*ToolCallFunctionArguments) UnmarshalJSON ¶
func (t *ToolCallFunctionArguments) UnmarshalJSON(data []byte) error
type ToolFunction ¶
type ToolFunction struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Parameters ToolFunctionParameters `json:"parameters"`
}
type ToolFunctionParameters ¶
type ToolFunctionParameters struct {
Type string `json:"type"`
Defs any `json:"$defs,omitempty"`
Items any `json:"items,omitempty"`
Required []string `json:"required,omitempty"`
Properties *ToolPropertiesMap `json:"properties"`
}
type ToolPropertiesMap ¶
type ToolPropertiesMap struct {
// contains filtered or unexported fields
}
func (ToolPropertiesMap) MarshalJSON ¶
func (t ToolPropertiesMap) MarshalJSON() ([]byte, error)
func (*ToolPropertiesMap) ToMap ¶
func (t *ToolPropertiesMap) ToMap() map[string]ToolProperty
func (*ToolPropertiesMap) UnmarshalJSON ¶
func (t *ToolPropertiesMap) UnmarshalJSON(data []byte) error
type ToolProperty ¶
type ToolProperty struct {
AnyOf []ToolProperty `json:"anyOf,omitempty"`
Type PropertyType `json:"type,omitempty"`
Items any `json:"items,omitempty"`
Description string `json:"description,omitempty"`
Enum []any `json:"enum,omitempty"`
Properties *ToolPropertiesMap `json:"properties,omitempty"`
}
func (ToolProperty) ToTypeScriptType ¶
func (tp ToolProperty) ToTypeScriptType() string
Click to show internal directories.
Click to hide internal directories.