openai

package
v1.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

* ChatCLI - Command Line Interface for LLM interaction * Copyright (c) 2024 Edilson Freitas * License: MIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenAIClient

type OpenAIClient struct {
	// contains filtered or unexported fields
}

OpenAIClient implementa o cliente para interagir com a API da OpenAI

func NewOpenAIClient

func NewOpenAIClient(apiKey, model string, logger *zap.Logger, maxAttempts int, backoff time.Duration) *OpenAIClient

NewOpenAIClient cria uma nova instância de OpenAIClient.

func (*OpenAIClient) GetModelName

func (c *OpenAIClient) GetModelName() string

GetModelName retorna o nome do modelo de linguagem utilizado pelo cliente.

func (*OpenAIClient) SendPrompt

func (c *OpenAIClient) SendPrompt(ctx context.Context, prompt string, history []models.Message) (string, error)

SendPrompt envia um prompt para o modelo de linguagem e retorna a resposta.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL