Documentation
¶
Overview ¶
Package prompts is a collection of primitives for prompts.
Index ¶
- Constants
- Variables
- type BodyProvider
- type ChatCompletionAnnotation
- type ChatCompletionAnnotationUrlCitation
- type ChatCompletionChoiceIndex
- type ChatCompletionMessageCustom
- type ChatCompletionMessageCustomToolCall
- type ChatCompletionMessageFunction
- type ChatCompletionMessageFunctionToolCall
- type ChatCompletionMessageToolCall
- type Client
- func (s *Client) APIKey(apiKey string) *Client
- func (s *Client) Add(key, value string) *Client
- func (s *Client) Base(rawURL ...string) *Client
- func (s *Client) Body(body io.Reader) *Client
- func (s *Client) BodyForm(bodyForm any) *Client
- func (s *Client) BodyJSON(bodyJSON any) *Client
- func (s *Client) BodyProvider(body BodyProvider) *Client
- func (s *Client) Client(httpClient *http.Client) *Client
- func (s *Client) Connect(pathURL string) *Client
- func (s *Client) Delete(pathURL string) *Client
- func (s *Client) Do(req *http.Request, successV, failureV any) (*http.Response, error)
- func (s *Client) Doer(doer Doer) *Client
- func (s *Client) Get(pathURL string) *Client
- func (s *Client) Head(pathURL string) *Client
- func (s *Client) New() *Client
- func (s *Client) Options(pathURL string) *Client
- func (s *Client) Patch(pathURL string) *Client
- func (s *Client) Path(path string) *Client
- func (s *Client) Post(pathURL string) *Client
- func (s *Client) Put(pathURL string) *Client
- func (s *Client) QueryStruct(queryStruct any) *Client
- func (s *Client) Receive(ctx context.Context, successV, failureV any) (*http.Response, error)
- func (s *Client) ReceiveSuccess(ctx context.Context, successV any) (*http.Response, error)
- func (s *Client) Request(ctx context.Context) (*http.Request, error)
- func (s *Client) ResponseDecoder(decoder ResponseDecoder) *Client
- func (s *Client) Set(key, value string) *Client
- func (s *Client) SetBasicAuth(username, password string) *Client
- func (s *Client) Trace(pathURL string) *Client
- type Completion
- type CompletionEvent
- type CompletionEventStream
- type CompletionUsage
- type CustomDefinition
- type CustomTool
- type Doer
- type File
- type FunctionDefinition
- type FunctionParameters
- type FunctionProperties
- type FunctionTool
- type Image
- type Input
- type MessageContent
- type MessageContentFile
- type MessageContentImage
- type MessageContentText
- type Output
- type OutputFunctionCall
- type OutputMessage
- type OutputMessageContent
- type OutputMessageContentText
- type Prompt
- type PromptError
- type PromptOpt
- type Promptable
- type ResponseDecoder
- type SSEvent
- type SearchResult
- type Tool
- type ToolChoice
- type Unimplemented
Constants ¶
const ( // FinishReasonStop indicates that the chat completion was finished because the model stopped generating content. FinishReasonStop = "stop" // FinishReasonLength indicates that the chat completion was finished because the maximum length was reached. FinishReasonLength = "length" // FinishReasonContentFilter indicates that the chat completion was finished because the content filter was triggered. FinishReasonContentFilter = "content_filter" // FinishReasonUnknown indicates that the chat completion was finished for an unknown reason. FinishReasonUnknown = "" )
const ( // StatusInProgress indicates that the response is in progress. StatusInProgress = "in_progress" // StatusCompleted indicates that the response is completed. StatusCompleted = "completed" // StatusIncomplete indicates that the response is incomplete. StatusIncomplete = "incomplete" )
const ( RoleNone = "" RoleUser = "user" RoleTool = "tool" RoleSystem = "system" RoleFunction = "function" RoleAssistant = "assistant" RoleDeveloper = "developer" RoleAgent = "agent" )
Roles of a message in a model prompt.
const ( // EventResponseStreamed is an event type that indicates that the response has been created. EventResponseCreated = "response.created" // EventResponseCompleted is an event type that indicates that the response has been completed. EventResponseCompleted = "respone.completed" // EventResponseFailed is an event type that indicates that the response has failed. EventResponseFailed = "response.failed" )
const DefaultTimeout = 30 * time.Second
DefaultTimeout is the default timeout for the Perplexity API.
Variables ¶
var DefaultClient = &http.Client{ Timeout: DefaultTimeout, }
DefaultClient is the default HTTP client for the Perplexity API.
var ErrInvalidSequence = fmt.Errorf("invalid event sequence")
ErrInvalidSequence is returned when the event sequence is invalid.
var ErrNotImplemented = fmt.Errorf("prompts: not implemented")
ErrNotImplemented is returned when a method is not implemented.
Functions ¶
This section is empty.
Types ¶
type BodyProvider ¶
type BodyProvider interface {
// ContentType returns the Content-Type of the body.
ContentType() string
// Body returns the io.Reader body.
Body() (io.Reader, error)
}
BodyProvider provides Body content for http.Request attachment.
type ChatCompletionAnnotation ¶
type ChatCompletionAnnotation struct {
// Type is the type of the annotation.
Type string `json:"type,omitempty"`
// URLCitation is the URL citation for the chat completion.
URLCitation ChatCompletionAnnotationUrlCitation `json:"url_citation,omitzero"`
}
ChatCompletionAnnotation is the annotation for the chat completion.
type ChatCompletionAnnotationUrlCitation ¶
type ChatCompletionAnnotationUrlCitation struct {
// Title is the title of the URL citation.
Title string `json:"title,omitempty"`
// URL is the URL of the URL citation.
URL string `json:"url,omitempty"`
// StartIndex is the start index of the URL citation in the content.
StartIndex int `json:"start_index,omitempty"`
// EndIndex is the end index of the URL citation in the content.
EndIndex int `json:"end_index,omitempty"`
}
ChatCompletionAnnotationUrlCitation is the URL citation for the chat completion.
type ChatCompletionChoiceIndex ¶
type ChatCompletionChoiceIndex struct {
// Role is the role of the message sender.
Role string `json:"role"`
// Content is the content of the message.
Content string `json:"content"`
// Annotations is the annotations for the message.
Annotations []ChatCompletionAnnotation `json:"annotations,omitempty"`
// ToolCalls is the tool calls for the message.
ToolCalls []ChatCompletionMessageToolCall `json:"tool_calls,omitempty"`
}
ChatCompletionChoiceIndex is the index for the chat completion.
type ChatCompletionMessageCustomToolCall ¶
type ChatCompletionMessageCustomToolCall struct {
// ID is the unique identifier for the custom tool call.
ID string `json:"id,omitempty"`
// Type is the type of the custom tool being called.
Type string `json:"type,omitempty"`
// Custom is the custom tool being called.
Custom ChatCompletionMessageCustom `json:"custom"`
}
ChatCompletionMessageCustomToolCall represents a custom tool call in a chat completion message.
type ChatCompletionMessageFunction ¶
type ChatCompletionMessageFunction struct {
// Name is the name of the function.
Name string `json:"name,omitempty"`
// Arguments is the arguments for the function.
Arguments map[string]any `json:"arguments,omitempty"`
}
ChatCompletionMessageFunction represents a function in a chat completion message.
type ChatCompletionMessageFunctionToolCall ¶
type ChatCompletionMessageFunctionToolCall struct {
// ID is the unique identifier for the function tool call.
ID string `json:"id,omitempty"`
// Type is the type of the custom tool being called.
Type string `json:"type,omitempty"`
// Function is the function being called.
Function ChatCompletionMessageFunction `json:"function,omitzero"`
}
ChatCompletionMessageFunctionToolCall represents a function tool call in a chat completion message.
type ChatCompletionMessageToolCall ¶
type ChatCompletionMessageToolCall struct {
// ToolCall is the name of the tool being called.
ToolCall isToolCall
}
ChatCompletionMessageToolCall represents a tool call in a chat completion message.
func (*ChatCompletionMessageToolCall) UnmarshalJSON ¶
func (c *ChatCompletionMessageToolCall) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for ChatCompletionMessageToolCall.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a struct for sending HTTP requests. It holds the http Client and the response decoder.
func (*Client) APIKey ¶
APIKey sets the Authorization header to use the provided API key with the Bearer scheme.
func (*Client) Add ¶
Add adds the key, value pair in Headers, appending values for existing keys to the key's values. Header keys are canonicalized.
func (*Client) Base ¶
Base sets the rawURL. If you intend to extend the url with Path, baseUrl should be specified with a trailing slash.
func (*Client) Body ¶
Body sets the Client's body. The body value will be set as the Body on new requests (see Request()). If the provided body is also an io.Closer, the request Body will be closed by http.Client methods.
func (*Client) BodyForm ¶
BodyForm sets the Client's bodyForm. The value pointed to by the bodyForm will be url encoded as the Body on new requests (see Request()). The bodyForm argument should be a pointer to a url tagged struct. See https://godoc.org/github.com/google/go-querystring/query for details.
func (*Client) BodyJSON ¶
BodyJSON sets the Client's bodyJSON. The value pointed to by the bodyJSON will be JSON encoded as the Body on new requests (see Request()). The bodyJSON argument should be a pointer to a JSON tagged struct. See https://golang.org/pkg/encoding/json/#MarshalIndent for details.
func (*Client) BodyProvider ¶
func (s *Client) BodyProvider(body BodyProvider) *Client
BodyProvider sets the Client's body provider.
func (*Client) Client ¶
Client sets the http Client used to do requests. If a nil client is given, the http.DefaultClient will be used.
func (*Client) Do ¶
Do sends an HTTP request and returns the response. Success responses (2XX) are JSON decoded into the value pointed to by successV and other responses are JSON decoded into the value pointed to by failureV. If the status code of response is 204(no content) or the Content-Length is 0, decoding is skipped. Any error sending the request or decoding the response is returned.
func (*Client) Doer ¶
Doer sets the custom Doer implementation used to do requests. If a nil client is given, the http.DefaultClient will be used.
func (*Client) New ¶
New returns a copy of a Client for creating a new Client with properties from a parent Client. For example,
parentClient := clients.New().Client(client).Base("https://api.io/")
fooClient := parentClient.New().Get("foo/")
barClient := parentClient.New().Get("bar/")
fooClient and barClient will both use the same client, but send requests to https://api.io/foo/ and https://api.io/bar/ respectively.
Note that query and body values are copied so if pointer values are used, mutating the original value will mutate the value within the child Client.
func (*Client) Path ¶
Path extends the rawURL with the given path by resolving the reference to an absolute URL. If parsing errors occur, the rawURL is left unmodified.
func (*Client) QueryStruct ¶
QueryStruct appends the given queryStruct to the Client's queryStructs. The queryStruct argument should be a pointer to a url tagged struct. See https://godoc.org/github.com/google/go-querystring/query for details. Any error encoding the queryStruct will be returned when creating a request (see Request()).
func (*Client) Receive ¶
Receive creates a new HTTP request and returns the response. Success responses (2XX) are JSON decoded into the value pointed to by successV and other responses are JSON decoded into the value pointed to by failureV. If the status code of response is 204(no content) or the Content-Length is 0, decoding is skipped. Any error creating the request, sending it, or decoding the response is returned. Receive is shorthand for calling Request and Do.
func (*Client) ReceiveSuccess ¶
ReceiveSuccess creates a new HTTP request and returns the response. Success responses (2XX) are JSON decoded into the value pointed to by successV. Any error creating the request, sending it, or decoding a 2XX response is returned.
func (*Client) Request ¶
Request returns a new http.Request created with the Sling properties. Returns any errors parsing the rawURL, encoding query structs, encoding the body, or creating the http.Request.
func (*Client) ResponseDecoder ¶
func (s *Client) ResponseDecoder(decoder ResponseDecoder) *Client
ResponseDecoder sets the Client's response decoder.
func (*Client) Set ¶
Set sets the key, value pair in Headers, replacing existing values associated with key. Header keys are canonicalized.
func (*Client) SetBasicAuth ¶
SetBasicAuth sets the Authorization header to use HTTP Basic Authentication with the provided username and password. With HTTP Basic Authentication the provided username and password are not encrypted.
type Completion ¶
type Completion struct {
// ID is the unique identifier for the response
ID string `json:"id,omitempty"`
// Object is the type of object returned
Object string `json:"object,omitempty"`
// CreatedAt is the timestamp of when the response was created
CreatedAt int64 `json:"created_at,omitempty"`
// Status is the status of the response
Status string `json:"status,omitempty"`
// CompletedAt is the timestamp of when the response was completed
CompletedAt int64 `json:"completed_at,omitempty"`
// Instructions is the instructions for the chat completion response
Instructions string `json:"instructions,omitempty"`
// ParallelToolCalls indicates whether the tool calls were executed in parallel
ParallelToolCalls bool `json:"parallel_tool_calls,omitempty"`
// Output is the output of the chat completion response
Output []Output `json:"output,omitempty"`
}
Completion represents a chat completion response.
type CompletionEvent ¶
type CompletionEvent struct {
// Type is the type of the event.
Type string `json:"type"`
// SequenceNumber is the sequence number of the event.
SequenceNumber int `json:"sequence_number"`
// Data is the data associated with the event.
Response *Completion `json:"response"`
// Raw is the raw data associated with the event. This is useful for debugging purposes.
Raw SSEvent `json:"-"`
}
CompletionEvent is an event that is returned from an API.
type CompletionEventStream ¶
type CompletionEventStream chan CompletionEvent
CompletionEventStream is a stream of completion events.
func NewCompletionEventStream ¶
func NewCompletionEventStream() CompletionEventStream
NewCompletionEventStream creates a new completion event stream.
func (CompletionEventStream) Close ¶
func (s CompletionEventStream) Close()
Close closes the stream.
type CompletionUsage ¶
type CompletionUsage struct {
// PromptTokens is the number of tokens in the prompt.
PromptTokens int `json:"prompt_tokens,omitempty"`
// CompletionTokens is the number of tokens in the completion.
CompletionTokens int `json:"completion_tokens,omitempty"`
// TotalTokens is the total number of tokens used in the chat completion.
TotalTokens int `json:"total_tokens,omitempty"`
}
CompletionUsage represents the usage of the chat completion.
type CustomDefinition ¶
type CustomDefinition struct {
// Name is the name of the custom tool.
Name string `json:"name"`
// Description is the description of the custom tool.
Description string `json:"description,omitempty"`
}
CustomDefinition represents the custom definition for the chat completion request.
type CustomTool ¶
type CustomTool struct {
// Custom is the custom tool for the chat completion request.
Custom CustomDefinition `json:"custom,omitzero"`
}
CustomTool represents a custom tool for the chat completion request.
func (CustomTool) MarshalJSON ¶
func (c CustomTool) MarshalJSON() ([]byte, error)
MarshalJSON marshals the response custom tool into JSON.
type Doer ¶
Doer executes http requests. It is implemented by *http.Client. You can wrap *http.Client with layers of Doers to form a stack of client-side middleware.
type File ¶
type File struct {
// Name is the name of the file.
Name string `json:"name"`
// URL is the URL of the file.
URL string `json:"url"`
}
File is the file for the response message content.
type FunctionDefinition ¶
type FunctionDefinition struct {
// Name is the name of the function.
Name string `json:"name"`
// Description is the description of the function.
Description string `json:"description,omitempty"`
// Parameters is the parameters for the function.
Parameters FunctionParameters `json:"parameters,omitzero"`
// Strict is a flag to indicate whether to strictly enforce the parameters.
Strict bool `json:"strict,omitempty"`
}
FunctionDefinition represents the function definition for the chat completion request.
type FunctionParameters ¶
type FunctionParameters struct {
// Properties is the properties for the function tool.
Properties FunctionProperties `json:"properties,omitempty"`
// Required is the required parameters for the function tool.
Required []string `json:"required,omitempty"`
}
FunctionParameters represents the parameters for the function tool.
func (FunctionParameters) MarshalJSON ¶
func (c FunctionParameters) MarshalJSON() ([]byte, error)
MarshalJSON marshals the response function parameters into JSON.
type FunctionProperties ¶
type FunctionProperties map[string]json.RawMessage
FunctionProperties represents the properties for the function tool.
type FunctionTool ¶
type FunctionTool struct {
// Function is the function for the chat completion request.
Function FunctionDefinition `json:"function,omitzero"`
}
FunctionTool represents a function tool for the chat completion request.
func (FunctionTool) MarshalJSON ¶
func (c FunctionTool) MarshalJSON() ([]byte, error)
MarshalJSON marshals the response function tool into JSON.
type Image ¶
type Image struct {
// URL is the URL of the image.
URL string `json:"url,omitempty"`
// Base64 is the base64 encoding of the image.
Base64 string `json:"base64,omitempty"`
// Name is the name of the image.
Name string `json:"name,omitempty"`
}
Image is a type that represents an image.
type Input ¶
type Input struct {
// Role is the role of the message sender.
Role string `json:"role"`
// Content is the content of the message.
Content []MessageContent `json:"content"`
// Name is the name of the message sender (optional).
Name string `json:"name,omitempty"`
}
Input is the message for chat completion.
type MessageContent ¶
type MessageContent struct {
Content isMessageContent
}
MessageContent is the content of a response message.
func NewMessageContent ¶
func NewMessageContent() MessageContent
NewMessageContent creates a new response message content.
func (MessageContent) GetFile ¶
func (c MessageContent) GetFile() (MessageContentFile, bool)
GetFile returns the file content of the response message content.
func (MessageContent) GetImage ¶
func (c MessageContent) GetImage() (MessageContentImage, bool)
GetImage returns the image content of the response message content.
func (MessageContent) GetText ¶
func (c MessageContent) GetText() (MessageContentText, bool)
GetText returns the text content of the response message content.
func (MessageContent) MarshalJSON ¶
func (c MessageContent) MarshalJSON() ([]byte, error)
MarshalJSON marshals the response message content into JSON.
func (*MessageContent) Reset ¶
func (c *MessageContent) Reset()
Reset resets the response message content.
type MessageContentFile ¶
type MessageContentFile struct {
File File `json:"file"`
}
MessageContentFile is the file content of a response message.
type MessageContentImage ¶
type MessageContentImage struct {
Image Image `json:"image"`
}
MessageContentImage is the image content of a response message.
type MessageContentText ¶
type MessageContentText struct {
// Text is the text of the content.
Text string `json:"text"`
}
MessageContentText is the text content of a response message.
func (MessageContentText) MarshalJSON ¶
func (c MessageContentText) MarshalJSON() ([]byte, error)
MarshalJSON marshals the response message content text into JSON.
type Output ¶
type Output struct {
// Output is the output of the completion of the response.
Output isOutput
}
Output represents the output of the chat completion response.
func (*Output) GetFunctionCall ¶
func (r *Output) GetFunctionCall() (*OutputFunctionCall, bool)
GetFunctionCall returns the function call if the output is a function call.
func (*Output) GetMessage ¶
func (r *Output) GetMessage() (*OutputMessage, bool)
GetMessage returns the message if the output is a message.
func (*Output) UnmarshalJSON ¶
type OutputFunctionCall ¶
type OutputFunctionCall struct {
// ID is the unique identifier for the function call output.
ID string `json:"id,omitempty"`
// CallID is the unique identifier for the function call.
CallID string `json:"call_id,omitempty"`
// Status is the status of the message output.
Status string `json:"status,omitempty"`
// Role is the role of the message sender.
Role string `json:"role"`
// Name is the name of the function being called.
Name string `json:"name,omitempty"`
// Arguments is the arguments for the function being called.
Arguments string `json:"arguments,omitempty"`
}
OutputFunctionCall represents a function call output in the chat completion response.
type OutputMessage ¶
type OutputMessage struct {
// ID is the unique identifier for the message output.
ID string `json:"id,omitempty"`
// Status is the status of the message output.
Status string `json:"status,omitempty"`
// Role is the role of the message sender.
Role string `json:"role"`
// OutputMessageContent is the content of the message output.
OutputMessageContent []OutputMessageContent `json:"content,omitzero"`
}
OutputMessage represents a message output in the chat completion response.
type OutputMessageContent ¶
type OutputMessageContent struct {
// Content is the content of the message output.
Content isOutputMessageContent
}
OutputMessageContent represents the content of a message output in the chat completion response.
func (*OutputMessageContent) UnmarshalJSON ¶
func (c *OutputMessageContent) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for OutputMessageContent.
type OutputMessageContentText ¶
type OutputMessageContentText struct {
// Text is the text content of the message output.
Text string `json:"text,omitempty"`
}
OutputMessageContentText represents a text content of a message output in the chat completion response.
type Prompt ¶
type Prompt struct {
// Model is the model for the chat completion request.
Model string `json:"model"`
// Input is the list of messages for the chat completion request.
Input []Input `json:"input"`
// Instructions is the instructions for the chat completion request.
Instructions string `json:"instructions,omitempty"`
// Tools is the list of tools to use for the chat completion request.
Tools []Tool `json:"tools,omitempty"`
// ToolChoice is the tool choice for the chat completion request.
ToolChoice ToolChoice `json:"tool_choice,omitempty"`
// MaxTokens is the maximum number of tokens for the chat completion request.
MaxTokens *int `json:"max_tokens,omitzero"`
// Temperature is the sampling temperature
Temperature *float32 `json:"temperature,omitzero"`
// Stream is a flag to enable streaming
Stream bool `json:"stream,omitempty"`
// TopP is the nucleus sampling parameter
TopP *float64 `json:"top_p,omitzero"`
// TopK is the number of top tokens to sample from
TopK *int `json:"top_k,omitzero"`
}
Prompt is a chat completion request.
type PromptError ¶
type PromptError struct {
Code int `json:"code"`
Message string `json:"error"`
Type string `json:"type"`
Param string `json:"param"`
}
PromptError is an error that can be returned by the prompts package.
func NewPromptError ¶
func NewPromptError() *PromptError
NewPromptError returns a new instance of prompts.PromptError.
func (*PromptError) Error ¶
func (e *PromptError) Error() string
Error returns the error message associated with the Err instance.
func (*PromptError) UnmarshalJSON ¶
func (e *PromptError) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the JSON data into the Err instance.
type PromptOpt ¶
type PromptOpt func(*Prompt)
PromptOpt is a function type for configuring the ResponseRequest.
func WithInstructions ¶
WithInstructions sets the instructions for the chat completion request.
func WithStream ¶
func WithStream() PromptOpt
WithStream sets whether or not to stream the chat completion response.
type Promptable ¶
type Promptable interface {
// Do completes a prompt and returns the completion.
Do(ctx context.Context, prompt *Prompt) (*Completion, error)
// AsStream completes a prompt and returns the completion as a stream.
AsStream(ctx context.Context, prompt *Prompt, stream CompletionEventStream) error
}
Promptable is an interface that enables to send a prompt.
type ResponseDecoder ¶
type ResponseDecoder interface {
// Decode decodes the response into the value pointed to by v.
Decode(resp *http.Response, v any) error
}
ResponseDecoder decodes http responses into struct values.
func NewByteStreamer ¶
func NewByteStreamer() ResponseDecoder
NewByteStreamer returns a ResponseDecoder that copies the response body into an io.Writer instance.
func NewCompletionEventDecoder ¶
func NewCompletionEventDecoder() ResponseDecoder
NewCompletionEventDecoder returns a new SSE decoder.
func NewJSONDecoder ¶
func NewJSONDecoder() ResponseDecoder
NewJSONDecoder returns a ResponseDecoder that decodes JSON responses into struct values.
type SSEvent ¶
type SSEvent struct {
// ID is the unique identifier for this event.
ID []byte
// Event is the name of the event.
Event []byte
// Data is the content of this message.
Data []byte
// Retry is the reconnection time (milliseconds).
Retry []byte
}
SSEvent is an event emitted by the server.
type SearchResult ¶
type SearchResult struct {
// Title is the title of the search result
Title string `json:"title,omitempty"`
// URL is the URL of the search result
URL string `json:"url,omitempty"`
// Snippet is the snippet of the search result
Snippet string `json:"snippet,omitempty"`
// Source is the source of the search result
Source string `json:"source,omitempty"`
}
SearchResult represents a search result structure for chat completion API.
type Tool ¶
type Tool struct {
Tool isCompletionTool
}
Tool is an interface that represents a tool for the chat completion request.
func (Tool) MarshalJSON ¶
MarshalJSON marshals the response tool into JSON.
type ToolChoice ¶
type ToolChoice string
const ( // ToolChoiceAuto is the auto tool choice. ToolChoiceAuto ToolChoice = "auto" // ToolChoiceAll is the all tool choice. ToolChoiceNone ToolChoice = "none" // ToolChoiceRequired is the required tool choice. ToolChoiceRequired ToolChoice = "required" )
type Unimplemented ¶
type Unimplemented struct{}
Unimplemented is an unimplemented Promptable.
func (*Unimplemented) AsStream ¶
func (u *Unimplemented) AsStream(_ context.Context, _ *Prompt, _ CompletionEventStream) error
AsStream is an unimplemented method.
func (*Unimplemented) Do ¶
func (u *Unimplemented) Do(_ context.Context, _ *Prompt) (*Completion, error)
Complete is an unimplemented method.