Documentation
¶
Index ¶
- Variables
- func PrettyPrint(obj interface{})
- func StructToUrlValues(i interface{}) (values url.Values)
- type ChatTransOption
- type Config
- type ErrorPapaoResponse
- type ImageTransOption
- type KopenAiGpt
- type Lang
- type NaverOpenApi
- type NaverOpenApiConfig
- type OpenAiConfig
- type RequestBuilder
- type TransOption
- type TranslationRequest
- type TranslationResponse
- type TranslationResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultChatRequest = openai.ChatCompletionRequest{ Model: openai.GPT3Dot5Turbo, Messages: []openai.ChatCompletionMessage{ { Role: openai.ChatMessageRoleUser, }, }, } DefaultImageRequest = openai.ImageRequest{ N: 1, ResponseFormat: openai.CreateImageResponseFormatB64JSON, Size: openai.CreateImageSize512x512, } )
Functions ¶
func PrettyPrint ¶
func PrettyPrint(obj interface{})
func StructToUrlValues ¶
Types ¶
type ChatTransOption ¶
type ChatTransOption struct { InputPrompt *TransOption OutputPrompt *TransOption }
type ErrorPapaoResponse ¶
type ImageTransOption ¶
type ImageTransOption struct {
InputPrompt *TransOption
}
type KopenAiGpt ¶
type KopenAiGpt struct {
// contains filtered or unexported fields
}
func NewKopenAiGpt ¶
func NewKopenAiGpt(config *Config) *KopenAiGpt
func (*KopenAiGpt) Chat ¶
func (k *KopenAiGpt) Chat(ctx context.Context, request openai.ChatCompletionRequest, option ChatTransOption) (resp openai.ChatCompletionResponse, err error)
func (*KopenAiGpt) ImageGenerate ¶
func (k *KopenAiGpt) ImageGenerate(ctx context.Context, request openai.ImageRequest, option ImageTransOption) (resp openai.ImageResponse, err error)
ImageGenerate https://platform.openai.com/docs/api-reference/images/create
type NaverOpenApi ¶
type NaverOpenApi struct {
// contains filtered or unexported fields
}
func NewNaverOpenApiClient ¶
func NewNaverOpenApiClient(config NaverOpenApiConfig) *NaverOpenApi
func (*NaverOpenApi) Transition ¶
func (c *NaverOpenApi) Transition(ctx context.Context, request *TranslationRequest) (response *TranslationResponse, err error)
type NaverOpenApiConfig ¶
type NaverOpenApiConfig struct {}
type OpenAiConfig ¶
type OpenAiConfig struct {
ApiKey string `yaml:"apiKey"`
}
type RequestBuilder ¶
type RequestBuilder struct{}
func NewRequestBuilder ¶
func NewRequestBuilder() *RequestBuilder
type TransOption ¶
type TranslationRequest ¶
type TranslationResponse ¶
type TranslationResponse struct { Message struct { Type string `json:"@type"` Service string `json:"@service"` Version string `json:"@version"` Result TranslationResult } `json:"message"` }
type TranslationResult ¶
Click to show internal directories.
Click to hide internal directories.