Documentation
¶
Index ¶
- type Instructor
- func (i *Instructor) Chat(ctx context.Context, request *anthropic.MessagesRequest, responseType any, ...) error
- func (i *Instructor) CountUsageFromResponse(response *anthropic.MessagesResponse, usage *instructor.UsageSum)
- func (i *Instructor) EmptyResponseWithResponseUsage(ret *anthropic.MessagesResponse, response *anthropic.MessagesResponse)
- func (i *Instructor) EmptyResponseWithUsageSum(ret *anthropic.MessagesResponse, usage *instructor.UsageSum)
- func (i *Instructor) Handler(ctx context.Context, request *anthropic.MessagesRequest, ...) (string, error)
- func (i *Instructor) SchemaStream(ctx context.Context, request *anthropic.MessagesRequest, responseType any, ...) (<-chan any, <-chan instructor.StreamData, error)
- func (i *Instructor) SchemaStreamHandler(ctx context.Context, request *anthropic.MessagesRequest, ...) (<-chan instructor.StreamData, error)
- func (i *Instructor) SetUsageSumToResponse(response *anthropic.MessagesResponse, usage *instructor.UsageSum)
- func (i *Instructor) Stream(ctx context.Context, request *anthropic.MessagesRequest, responseType any, ...) (<-chan instructor.StreamData, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instructor ¶
type Instructor struct {
*anthropic.Client
instructor.Options
}
func New ¶
func New(client *anthropic.Client, opts ...instructor.Option) *Instructor
func (*Instructor) Chat ¶
func (i *Instructor) Chat(ctx context.Context, request *anthropic.MessagesRequest, responseType any, response *anthropic.MessagesResponse) error
func (*Instructor) CountUsageFromResponse ¶
func (i *Instructor) CountUsageFromResponse(response *anthropic.MessagesResponse, usage *instructor.UsageSum)
func (*Instructor) EmptyResponseWithResponseUsage ¶
func (i *Instructor) EmptyResponseWithResponseUsage(ret *anthropic.MessagesResponse, response *anthropic.MessagesResponse)
func (*Instructor) EmptyResponseWithUsageSum ¶
func (i *Instructor) EmptyResponseWithUsageSum(ret *anthropic.MessagesResponse, usage *instructor.UsageSum)
func (*Instructor) Handler ¶
func (i *Instructor) Handler(ctx context.Context, request *anthropic.MessagesRequest, response *anthropic.MessagesResponse) (string, error)
func (*Instructor) SchemaStream ¶ added in v1.2.2
func (i *Instructor) SchemaStream( ctx context.Context, request *anthropic.MessagesRequest, responseType any, response *anthropic.MessagesResponse, ) (<-chan any, <-chan instructor.StreamData, error)
func (*Instructor) SchemaStreamHandler ¶ added in v1.2.2
func (i *Instructor) SchemaStreamHandler(ctx context.Context, request *anthropic.MessagesRequest, response *anthropic.MessagesResponse) (<-chan instructor.StreamData, error)
func (*Instructor) SetUsageSumToResponse ¶
func (i *Instructor) SetUsageSumToResponse(response *anthropic.MessagesResponse, usage *instructor.UsageSum)
func (*Instructor) Stream ¶
func (i *Instructor) Stream( ctx context.Context, request *anthropic.MessagesRequest, responseType any, response *anthropic.MessagesResponse, ) (<-chan instructor.StreamData, error)
Click to show internal directories.
Click to hide internal directories.