Documentation
¶
Index ¶
- func ConvertMessageFrom(src *instructor.Message, dist *cohere.Message)
- func ConvertMessageTo(src *cohere.Message, dist *instructor.Message) error
- type Instructor
- func (i *Instructor) Chat(ctx context.Context, request *cohere.ChatRequest, responseType any, ...) error
- func (i *Instructor) CountUsageFromResponse(response *cohere.NonStreamedChatResponse, usage *instructor.UsageSum)
- func (i *Instructor) EmptyResponseWithResponseUsage(ret *cohere.NonStreamedChatResponse, response *cohere.NonStreamedChatResponse)
- func (i *Instructor) EmptyResponseWithUsageSum(ret *cohere.NonStreamedChatResponse, usage *instructor.UsageSum)
- func (i *Instructor) Handler(ctx context.Context, request *cohere.ChatRequest, ...) (string, error)
- func (i *Instructor) SchemaStream(ctx context.Context, request *cohere.ChatStreamRequest, responseType any, ...) (<-chan any, <-chan instructor.StreamData, error)
- func (i *Instructor) SchemaStreamHandler(ctx context.Context, request *cohere.ChatStreamRequest, ...) (<-chan instructor.StreamData, error)
- func (i *Instructor) SetMemory(m *instructor.Memory)
- func (i *Instructor) SetUsageSumToResponse(response *cohere.NonStreamedChatResponse, usage *instructor.UsageSum)
- func (i *Instructor) Stream(ctx context.Context, request *cohere.ChatStreamRequest, responseType any, ...) (<-chan instructor.StreamData, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertMessageFrom ¶ added in v1.5.9
func ConvertMessageFrom(src *instructor.Message, dist *cohere.Message)
func ConvertMessageTo ¶ added in v1.5.9
func ConvertMessageTo(src *cohere.Message, dist *instructor.Message) error
Types ¶
type Instructor ¶
type Instructor struct {
*cohereClient.Client
instructor.Options
}
func New ¶
func New(client *cohereClient.Client, opts ...instructor.Option) *Instructor
func (*Instructor) Chat ¶
func (i *Instructor) Chat( ctx context.Context, request *cohere.ChatRequest, responseType any, response *cohere.NonStreamedChatResponse, ) error
func (*Instructor) CountUsageFromResponse ¶
func (i *Instructor) CountUsageFromResponse(response *cohere.NonStreamedChatResponse, usage *instructor.UsageSum)
func (*Instructor) EmptyResponseWithResponseUsage ¶
func (i *Instructor) EmptyResponseWithResponseUsage(ret *cohere.NonStreamedChatResponse, response *cohere.NonStreamedChatResponse)
func (*Instructor) EmptyResponseWithUsageSum ¶
func (i *Instructor) EmptyResponseWithUsageSum(ret *cohere.NonStreamedChatResponse, usage *instructor.UsageSum)
func (*Instructor) Handler ¶
func (i *Instructor) Handler(ctx context.Context, request *cohere.ChatRequest, response *cohere.NonStreamedChatResponse) (string, error)
func (*Instructor) SchemaStream ¶ added in v1.2.2
func (i *Instructor) SchemaStream( ctx context.Context, request *cohere.ChatStreamRequest, responseType any, response *cohere.NonStreamedChatResponse, ) (<-chan any, <-chan instructor.StreamData, error)
func (*Instructor) SchemaStreamHandler ¶ added in v1.2.2
func (i *Instructor) SchemaStreamHandler(ctx context.Context, request *cohere.ChatStreamRequest, response *cohere.NonStreamedChatResponse) (<-chan instructor.StreamData, error)
func (*Instructor) SetMemory ¶ added in v1.5.9
func (i *Instructor) SetMemory(m *instructor.Memory)
func (*Instructor) SetUsageSumToResponse ¶
func (i *Instructor) SetUsageSumToResponse(response *cohere.NonStreamedChatResponse, usage *instructor.UsageSum)
func (*Instructor) Stream ¶
func (i *Instructor) Stream( ctx context.Context, request *cohere.ChatStreamRequest, responseType any, response *cohere.NonStreamedChatResponse, ) (<-chan instructor.StreamData, error)
Click to show internal directories.
Click to hide internal directories.