Documentation
¶
Index ¶
- func ConvertMessageFrom(src *instructor.Message, dist *gemini.Content) error
- func ConvertMessageTo(src *gemini.Content, dist *instructor.Message)
- func DataFromURL(link string, w io.Writer) error
- type Instructor
- func (i *Instructor) CallMCP(ctx context.Context, toolUse *gemini.FunctionCall) (*gemini.Part, *instructor.ToolCall)
- func (i *Instructor) Chat(ctx context.Context, request *Request, responseType any, ...) error
- func (i *Instructor) CountUsageFromResponse(response *gemini.GenerateContentResponse, usage *instructor.UsageSum)
- func (i *Instructor) EmptyResponseWithResponseUsage(ret *gemini.GenerateContentResponse, response *gemini.GenerateContentResponse)
- func (i *Instructor) EmptyResponseWithUsageSum(ret *gemini.GenerateContentResponse, usage *instructor.UsageSum)
- func (i *Instructor) Handler(ctx context.Context, request *Request, ...) (string, error)
- func (i *Instructor) InjectMCP(ctx context.Context, req *gemini.GenerateContentConfig)
- func (i *Instructor) SchemaStream(ctx context.Context, request *Request, responseType any, ...) (<-chan any, <-chan instructor.StreamData, error)
- func (i *Instructor) SchemaStreamHandler(ctx context.Context, request *Request, ...) (<-chan instructor.StreamData, error)
- func (i *Instructor) SetClient(clt *gemini.Client)
- func (i *Instructor) SetMemory(m *instructor.Memory)
- func (i *Instructor) SetUsageSumToResponse(response *gemini.GenerateContentResponse, usage *instructor.UsageSum)
- func (i *Instructor) Stream(ctx context.Context, request *Request, responseType any, ...) (<-chan instructor.StreamData, error)
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertMessageFrom ¶ added in v1.5.7
func ConvertMessageFrom(src *instructor.Message, dist *gemini.Content) error
func ConvertMessageTo ¶ added in v1.5.7
func ConvertMessageTo(src *gemini.Content, dist *instructor.Message)
Types ¶
type Instructor ¶
type Instructor struct {
*gemini.Client
instructor.Options
}
func New ¶
func New(client *gemini.Client, opts ...instructor.Option) *Instructor
func (*Instructor) CallMCP ¶ added in v1.4.7
func (i *Instructor) CallMCP(ctx context.Context, toolUse *gemini.FunctionCall) (*gemini.Part, *instructor.ToolCall)
func (*Instructor) Chat ¶
func (i *Instructor) Chat( ctx context.Context, request *Request, responseType any, response *gemini.GenerateContentResponse, ) error
func (*Instructor) CountUsageFromResponse ¶
func (i *Instructor) CountUsageFromResponse(response *gemini.GenerateContentResponse, usage *instructor.UsageSum)
func (*Instructor) EmptyResponseWithResponseUsage ¶
func (i *Instructor) EmptyResponseWithResponseUsage(ret *gemini.GenerateContentResponse, response *gemini.GenerateContentResponse)
func (*Instructor) EmptyResponseWithUsageSum ¶
func (i *Instructor) EmptyResponseWithUsageSum(ret *gemini.GenerateContentResponse, usage *instructor.UsageSum)
func (*Instructor) Handler ¶
func (i *Instructor) Handler(ctx context.Context, request *Request, response *gemini.GenerateContentResponse) (string, error)
func (*Instructor) InjectMCP ¶ added in v1.4.7
func (i *Instructor) InjectMCP(ctx context.Context, req *gemini.GenerateContentConfig)
func (*Instructor) SchemaStream ¶ added in v1.2.2
func (i *Instructor) SchemaStream( ctx context.Context, request *Request, responseType any, response *gemini.GenerateContentResponse, ) (<-chan any, <-chan instructor.StreamData, error)
func (*Instructor) SchemaStreamHandler ¶ added in v1.2.2
func (i *Instructor) SchemaStreamHandler(ctx context.Context, request *Request, response *gemini.GenerateContentResponse) (<-chan instructor.StreamData, error)
func (*Instructor) SetClient ¶
func (i *Instructor) SetClient(clt *gemini.Client)
func (*Instructor) SetMemory ¶ added in v1.5.9
func (i *Instructor) SetMemory(m *instructor.Memory)
func (*Instructor) SetUsageSumToResponse ¶
func (i *Instructor) SetUsageSumToResponse(response *gemini.GenerateContentResponse, usage *instructor.UsageSum)
func (*Instructor) Stream ¶
func (i *Instructor) Stream( ctx context.Context, request *Request, responseType any, response *gemini.GenerateContentResponse, ) (<-chan instructor.StreamData, error)
Click to show internal directories.
Click to hide internal directories.