Documentation
¶
Index ¶
- Variables
- type Client
- type OpenAIClient
- func (c *OpenAIClient) AddMessage(threadID string, content string) error
- func (c *OpenAIClient) CreateRun(threadID string) (io.ReadCloser, error)
- func (c *OpenAIClient) CreateThread() (string, error)
- func (c *OpenAIClient) GetCompletion(systemPrompt string, userPrompt string) (string, error)
- func (c *OpenAIClient) RunThread(threadID string, responseChan chan<- string)
Constants ¶
This section is empty.
Variables ¶
View Source
var AssistantID string
View Source
var AssistantVersion string
Functions ¶
This section is empty.
Types ¶
type OpenAIClient ¶
type OpenAIClient struct {
// contains filtered or unexported fields
}
func NewOpenAIClient ¶
func NewOpenAIClient(conf *config.Config) *OpenAIClient
func (*OpenAIClient) AddMessage ¶
func (c *OpenAIClient) AddMessage(threadID string, content string) error
AddMessage adds a message to a previously created thread in the OpenAI API.
func (*OpenAIClient) CreateRun ¶
func (c *OpenAIClient) CreateRun(threadID string) (io.ReadCloser, error)
CreateRun starts a new run in a previously created thread in the OpenAI API, and returns a channel that will receive the response content in string chunks.
func (*OpenAIClient) CreateThread ¶
func (c *OpenAIClient) CreateThread() (string, error)
CreateThread creates a new thread in the OpenAI API and returns the thread ID.
func (*OpenAIClient) GetCompletion ¶
func (c *OpenAIClient) GetCompletion(systemPrompt string, userPrompt string) (string, error)
func (*OpenAIClient) RunThread ¶
func (c *OpenAIClient) RunThread(threadID string, responseChan chan<- string)
Click to show internal directories.
Click to hide internal directories.