Documentation ¶
Index ¶
- type OpenAIService
- func (s *OpenAIService) CountUserTransactions(userID uuid.UUID) (int64, error)
- func (s *OpenAIService) CreateTransaction(userID, threadID uuid.UUID, message, model, role string) (uuid.UUID, error)
- func (s *OpenAIService) DeleteTransaction(transactionID uuid.UUID) error
- func (s *OpenAIService) GetTransactionByID(transactionID uuid.UUID) (*openaimodel.OpenAITransaction, error)
- func (s *OpenAIService) GetTransactionsByThreadID(threadID uuid.UUID) ([]openaimodel.OpenAITransaction, error)
- func (s *OpenAIService) GetTransactionsByUserID(userID uuid.UUID) ([]openaimodel.OpenAITransaction, error)
- func (s *OpenAIService) SummarizeUserUsage(userID uuid.UUID) (int64, error)
- func (s *OpenAIService) UpdateTransaction(transaction *openaimodel.OpenAITransaction) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OpenAIService ¶
type OpenAIService struct {
// contains filtered or unexported fields
}
OpenAIService provides business logic for OpenAI transactions.
func NewOpenAIService ¶
func NewOpenAIService(openAIStore openaistorage.OpenAIStore, msgService *messagebusiness.MessageService) *OpenAIService
NewOpenAIService creates a new instance of OpenAIService.
func (*OpenAIService) CountUserTransactions ¶
func (s *OpenAIService) CountUserTransactions(userID uuid.UUID) (int64, error)
CountUserTransactions counts the total number of transactions for a specific user.
func (*OpenAIService) CreateTransaction ¶
func (*OpenAIService) DeleteTransaction ¶
func (s *OpenAIService) DeleteTransaction(transactionID uuid.UUID) error
DeleteTransaction deletes a transaction by its ID.
func (*OpenAIService) GetTransactionByID ¶
func (s *OpenAIService) GetTransactionByID(transactionID uuid.UUID) (*openaimodel.OpenAITransaction, error)
GetTransactionsByTran retrieves all transactions for a specific user.
func (*OpenAIService) GetTransactionsByThreadID ¶
func (s *OpenAIService) GetTransactionsByThreadID(threadID uuid.UUID) ([]openaimodel.OpenAITransaction, error)
GetTransactionByID retrieves a specific transaction by its ID.
func (*OpenAIService) GetTransactionsByUserID ¶
func (s *OpenAIService) GetTransactionsByUserID(userID uuid.UUID) ([]openaimodel.OpenAITransaction, error)
GetTransactionsByUserID retrieves all transactions for a specific user.
func (*OpenAIService) SummarizeUserUsage ¶
func (s *OpenAIService) SummarizeUserUsage(userID uuid.UUID) (int64, error)
SummarizeUserUsage calculates the total message length processed for a specific user.
func (*OpenAIService) UpdateTransaction ¶
func (s *OpenAIService) UpdateTransaction(transaction *openaimodel.OpenAITransaction) error
UpdateTransaction updates an existing OpenAI transaction.
Click to show internal directories.
Click to hide internal directories.