domain

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToCreateGptMessageResPb

func ToCreateGptMessageResPb(data CreateGptMessageRes) *v1.CreateGptMessageRes

Types

type ChatgptChoiceMessageRes

type ChatgptChoiceMessageRes struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type ChatgptChoiceRes

type ChatgptChoiceRes struct {
	FinishReason string                   `json:"finish_reason"`
	Index        string                   `json:"index"`
	Message      *ChatgptChoiceMessageRes `json:"message"`
}

type ChatgptMessageReq

type ChatgptMessageReq struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type ChatgptUsageRes

type ChatgptUsageRes struct {
	PromptTokes     string `json:"prompt_tokens"`
	CompletionTokes string `json:"completion_tokens"`
	TotalTokens     int64  `json:"total_tokens"`
}

type CreateGptMessageReq

type CreateGptMessageReq struct {
	Model    string               `json:"model"`
	Messages []*ChatgptMessageReq `json:"messages"`
}

func ToDomainCreateGptMessageReq

func ToDomainCreateGptMessageReq(data interface{}) *CreateGptMessageReq

ToDomainExample 将pb结构体转换为domain包下的Example结构体

type CreateGptMessageRes

type CreateGptMessageRes struct {
	Id      string              `json:"id"`
	Object  string              `json:"object"`
	Created int64               `json:"created"`
	Model   string              `json:"model"`
	Usage   *ChatgptUsageRes    `json:"usage"`
	Choices []*ChatgptChoiceRes `json:"choices"`
	Error   ErrorRes            `json:"error"`
}

type ErrorRes

type ErrorRes struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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