Documentation
¶
Index ¶
- type Message
- type MessageCreated
- type MessageOption
- func WithAssistantID(assistantID string) MessageOption
- func WithAttachments(attachments []assistant.Attachments) MessageOption
- func WithContent(content string) MessageOption
- func WithCreatedAt(createdAt int) MessageOption
- func WithMessageID(id string) MessageOption
- func WithMetadata(metadata map[string]string) MessageOption
- func WithObject(object string) MessageOption
- func WithRole(role string) MessageOption
- func WithRunID(runID string) MessageOption
- func WithThreadID(threadID string) MessageOption
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct {
ID string `json:"id,omitempty"`
Object string `json:"object,omitempty"`
CreatedAt int `json:"created_at,omitempty,omitempty"`
ThreadId string `json:"thread_id,omitempty"`
Role string `json:"role"`
Content string `json:"content"`
AssistantId string `json:"assistant_id,omitempty"`
RunId string `json:"run_id,omitempty"`
Attachments []assistant.Attachments `json:"attachments,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
func CreateMessage ¶
func CreateMessage(threadID, role string, content string, opts ...MessageOption) (*Message, error)
NewMessageinicializa um novo assistente, opcionalmente com um ID de assistente existente.
func RetrieveMessage ¶
type MessageCreated ¶
type MessageOption ¶
type MessageOption func(*Message)
func WithAssistantID ¶
func WithAssistantID(assistantID string) MessageOption
WithAssistantID configura o ID do assistente associado à mensagem.
func WithAttachments ¶
func WithAttachments(attachments []assistant.Attachments) MessageOption
WithAttachments configura os anexos da mensagem.
func WithContent ¶
func WithContent(content string) MessageOption
WithContent configura o conteúdo da mensagem.
func WithCreatedAt ¶
func WithCreatedAt(createdAt int) MessageOption
WithCreatedAt configura a data de criação da mensagem.
func WithMessageID ¶
func WithMessageID(id string) MessageOption
WithMessageID configura o ID da mensagem.
func WithMetadata ¶
func WithMetadata(metadata map[string]string) MessageOption
WithMetadata configura os metadados da mensagem.
func WithObject ¶
func WithObject(object string) MessageOption
WithObject configura o tipo de objeto da mensagem.
func WithRole ¶
func WithRole(role string) MessageOption
WithRole configura o papel (role) da mensagem.
func WithRunID ¶
func WithRunID(runID string) MessageOption
WithRunID configura o ID da execução da mensagem.
func WithThreadID ¶
func WithThreadID(threadID string) MessageOption
WithThreadID configura o ID da thread da mensagem.
type Response ¶
type Response struct {
ID string `json:"ID"`
Object string `json:"object"`
Data []MessageCreated `json:"data"`
FirstId string `json:"first_id,omitempty"`
LastId string `json:"last_id,omitempty"`
HasMore bool `json:"has_more,omitempty"`
Deleted bool `json:"deleted,omitempty"`
}
func DeleteMessage ¶
Delete an Thread.
func ListMessages ¶
Returns a list of messages for a given thread.