mirror of
https://github.com/LukeHagar/log10go.git
synced 2025-12-06 04:20:12 +00:00
99 lines
3.1 KiB
Go
99 lines
3.1 KiB
Go
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
|
|
package components
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// ChatCompletionResponseMessageRole - The role of the author of this message.
|
|
type ChatCompletionResponseMessageRole string
|
|
|
|
const (
|
|
ChatCompletionResponseMessageRoleAssistant ChatCompletionResponseMessageRole = "assistant"
|
|
)
|
|
|
|
func (e ChatCompletionResponseMessageRole) ToPointer() *ChatCompletionResponseMessageRole {
|
|
return &e
|
|
}
|
|
func (e *ChatCompletionResponseMessageRole) UnmarshalJSON(data []byte) error {
|
|
var v string
|
|
if err := json.Unmarshal(data, &v); err != nil {
|
|
return err
|
|
}
|
|
switch v {
|
|
case "assistant":
|
|
*e = ChatCompletionResponseMessageRole(v)
|
|
return nil
|
|
default:
|
|
return fmt.Errorf("invalid value for ChatCompletionResponseMessageRole: %v", v)
|
|
}
|
|
}
|
|
|
|
// ChatCompletionResponseMessageFunctionCall - Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
|
|
//
|
|
// Deprecated type: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
type ChatCompletionResponseMessageFunctionCall struct {
|
|
// The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
|
|
Arguments string `json:"arguments"`
|
|
// The name of the function to call.
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
func (o *ChatCompletionResponseMessageFunctionCall) GetArguments() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Arguments
|
|
}
|
|
|
|
func (o *ChatCompletionResponseMessageFunctionCall) GetName() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Name
|
|
}
|
|
|
|
// ChatCompletionResponseMessage - A chat completion message generated by the model.
|
|
type ChatCompletionResponseMessage struct {
|
|
// The contents of the message.
|
|
Content *string `json:"content"`
|
|
// The tool calls generated by the model, such as function calls.
|
|
ToolCalls []ChatCompletionMessageToolCall `json:"tool_calls,omitempty"`
|
|
// The role of the author of this message.
|
|
Role ChatCompletionResponseMessageRole `json:"role"`
|
|
// Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
|
|
//
|
|
// Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
FunctionCall *ChatCompletionResponseMessageFunctionCall `json:"function_call,omitempty"`
|
|
}
|
|
|
|
func (o *ChatCompletionResponseMessage) GetContent() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Content
|
|
}
|
|
|
|
func (o *ChatCompletionResponseMessage) GetToolCalls() []ChatCompletionMessageToolCall {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.ToolCalls
|
|
}
|
|
|
|
func (o *ChatCompletionResponseMessage) GetRole() ChatCompletionResponseMessageRole {
|
|
if o == nil {
|
|
return ChatCompletionResponseMessageRole("")
|
|
}
|
|
return o.Role
|
|
}
|
|
|
|
func (o *ChatCompletionResponseMessage) GetFunctionCall() *ChatCompletionResponseMessageFunctionCall {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.FunctionCall
|
|
}
|