openapi

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 2 Imported by: 0

README

Go API Server for openapi

Open AI(ChatGPT)几乎可以应用于任何涉及理解或生成自然语言或代码的任务。我们提供一系列具有不同功率级别的模型,适用于不同的任务,并且能够微调您自己的自定义模型。这些模型可用于从内容生成到语义搜索和分类的所有领域。

Overview

This server was generated by the [openapi-generator] (https://openapi-generator.tech) project. By using the OpenAPI-Spec from a remote server, you can easily generate a server stub.

To see how to make this your own, look here:

README

  • API version: 1.0.0
  • Build date: 2024-04-18T04:31:22.176815411Z[Etc/UTC]
  • Generator version: 7.5.0-SNAPSHOT
Running the server

To run the server, follow these simple steps:

go run main.go

To run the server in a docker container

docker build --network=host -t openapi .

Once the image is built, just run

docker run --rm -it openapi
Known Issue

Endpoints sharing a common path may result in issues. For example, /v2/pet/findByTags and /v2/pet/:petId will result in an issue with the Gin framework. For more information about this known limitation, please refer to gin-gonic/gin#388 for more information.

A workaround is to manually update the path and handler. Please refer to gin-gonic/gin/issues/205#issuecomment-296155497 for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHandleFunc

func DefaultHandleFunc(c *gin.Context)

Default handler for not yet implemented routes

func NewRouter

func NewRouter(handleFunctions ApiHandleFunctions) *gin.Engine

NewRouter returns a new router.

func NewRouterWithGinEngine

func NewRouterWithGinEngine(router *gin.Engine, handleFunctions ApiHandleFunctions) *gin.Engine

NewRouter add routes to existing gin engine.

Types

type ApiHandleFunctions

type ApiHandleFunctions struct {

	// Routes for the AssistantsBetaAPI part of the API
	AssistantsBetaAPI AssistantsBetaAPI
	// Routes for the AudioAPI part of the API
	AudioAPI AudioAPI
	// Routes for the ChatAPI part of the API
	ChatAPI ChatAPI
	// Routes for the CompletionsAPI part of the API
	CompletionsAPI CompletionsAPI
	// Routes for the EmbeddingsAPI part of the API
	EmbeddingsAPI EmbeddingsAPI
	// Routes for the FilesAPI part of the API
	FilesAPI FilesAPI
	// Routes for the FineTuningAPI part of the API
	FineTuningAPI FineTuningAPI
	// Routes for the ImagesAPI part of the API
	ImagesAPI ImagesAPI
	// Routes for the MessagesAPI part of the API
	MessagesAPI MessagesAPI
	// Routes for the ModelsAPI part of the API
	ModelsAPI ModelsAPI
	// Routes for the ModerationsAPI part of the API
	ModerationsAPI ModerationsAPI
	// Routes for the RunsAPI part of the API
	RunsAPI RunsAPI
	// Routes for the ThreadsAPI part of the API
	ThreadsAPI ThreadsAPI
}

type AssistantsBetaAPI

type AssistantsBetaAPI interface {

	// V1AssistantsAssistantIdDelete Delete /v1/assistants/:assistant_id
	// 删除助手
	V1AssistantsAssistantIdDelete(c *gin.Context)

	// V1AssistantsAssistantIdFilesFileIdDelete Delete /v1/assistants/:assistant_id/files/:file_id
	// 删除辅助文件
	V1AssistantsAssistantIdFilesFileIdDelete(c *gin.Context)

	// V1AssistantsAssistantIdFilesFileIdGet Get /v1/assistants/:assistant_id/files/:file_id
	// 检索助手文件
	V1AssistantsAssistantIdFilesFileIdGet(c *gin.Context)

	// V1AssistantsAssistantIdFilesGet Get /v1/assistants/:assistant_id/files
	// 列出助手文件
	V1AssistantsAssistantIdFilesGet(c *gin.Context)

	// V1AssistantsAssistantIdFilesPost Post /v1/assistants/:assistant_id/files
	// 创建辅助文件
	V1AssistantsAssistantIdFilesPost(c *gin.Context)

	// V1AssistantsAssistantIdGet Get /v1/assistants/:assistant_id
	// 检索助手
	V1AssistantsAssistantIdGet(c *gin.Context)

	// V1AssistantsAssistantIdPost Post /v1/assistants/:assistant_id
	// 修改助手
	V1AssistantsAssistantIdPost(c *gin.Context)

	// V1AssistantsGet Get /v1/assistants
	// 列出助手
	V1AssistantsGet(c *gin.Context)

	// V1AssistantsPost Post /v1/assistants
	// 创建助手
	V1AssistantsPost(c *gin.Context)
}

type AudioAPI

type AudioAPI interface {

	// V1AudioSpeechGet Get /v1/audio/speech
	// 创建语音
	V1AudioSpeechGet(c *gin.Context)

	// V1AudioTranscriptionsGet Get /v1/audio/transcriptions
	// 创建转录
	V1AudioTranscriptionsGet(c *gin.Context)

	// V1AudioTranscriptionsPost Post /v1/audio/transcriptions
	// 创建转录
	V1AudioTranscriptionsPost(c *gin.Context)

	// V1AudioTranslationsGet Get /v1/audio/translations
	// 创建翻译
	V1AudioTranslationsGet(c *gin.Context)

	// V1AudioTranslationsPost Post /v1/audio/translations
	// 创建翻译
	V1AudioTranslationsPost(c *gin.Context)
}

type ChatAPI

type ChatAPI interface {

	// V1ChatCompletionsPost Post /v1/chat/completions
	// 创建聊天补全
	V1ChatCompletionsPost(c *gin.Context)
}

type CompletionsAPI

type CompletionsAPI interface {

	// V1CompletionsPost Post /v1/completions
	// 创建完成
	V1CompletionsPost(c *gin.Context)
}

type EmbeddingsAPI

type EmbeddingsAPI interface {

	// V1EmbeddingsPost Post /v1/embeddings
	// 创建嵌入
	V1EmbeddingsPost(c *gin.Context)
}

type FilesAPI

type FilesAPI interface {

	// V1FilesFileIdContentGet Get /v1/files/:file_id/content
	// 检索文件内容
	V1FilesFileIdContentGet(c *gin.Context)

	// V1FilesFileIdDelete Delete /v1/files/:file_id
	// 删除文件
	V1FilesFileIdDelete(c *gin.Context)

	// V1FilesFileIdGet Get /v1/files/:file_id
	// 检索文件
	V1FilesFileIdGet(c *gin.Context)

	// V1FilesGet Get /v1/files _
	// 列出文件
	V1FilesGet(c *gin.Context)

	// V1FilesPost Post /v1/files
	// 上传文件
	V1FilesPost(c *gin.Context)
}

type FineTuningAPI

type FineTuningAPI interface {

	// V1FineTuningJobsFineTuningJobIdCancelPost Post /v1/fine_tuning/jobs/:fine_tuning_job_id/cancel
	// 取消微调
	V1FineTuningJobsFineTuningJobIdCancelPost(c *gin.Context)

	// V1FineTuningJobsFineTuningJobIdEventsGet Get /v1/fine_tuning/jobs/:fine_tuning_job_id/events
	// 列出微调事件
	V1FineTuningJobsFineTuningJobIdEventsGet(c *gin.Context)

	// V1FineTuningJobsFineTuningJobIdGet Get /v1/fine_tuning/jobs/:fine_tuning_job_id
	// 检索微调作业
	V1FineTuningJobsFineTuningJobIdGet(c *gin.Context)

	// V1FineTuningJobsGet Get /v1/fine_tuning/jobs
	// 列出微调作业
	V1FineTuningJobsGet(c *gin.Context)

	// V1FineTuningJobsPost Post /v1/fine_tuning/jobs
	// 创建微调作业
	V1FineTuningJobsPost(c *gin.Context)
}

type ImagesAPI

type ImagesAPI interface {

	// V1ImagesEditsPost Post /v1/images/edits
	// 创建图片编辑
	V1ImagesEditsPost(c *gin.Context)

	// V1ImagesGenerationsPost Post /v1/images/generations
	// 创建图像
	V1ImagesGenerationsPost(c *gin.Context)

	// V1ImagesVariationsPost Post /v1/images/variations
	// 创建图像变体
	V1ImagesVariationsPost(c *gin.Context)
}

type MessagesAPI

type MessagesAPI interface {

	// V1ThreadsThreadIdMessagesGet Get /v1/threads/:thread_id/messages
	// 列出消息
	V1ThreadsThreadIdMessagesGet(c *gin.Context)

	// V1ThreadsThreadIdMessagesMessageIdFilesFileIdGet Get /v1 /threads/:thread_id/messages/:message_id/files/:file_id
	// 检索消息文件
	V1ThreadsThreadIdMessagesMessageIdFilesFileIdGet(c *gin.Context)

	// V1ThreadsThreadIdMessagesMessageIdFilesGet Get /v1/threads/:thread_id/messages/:message_id/files _
	// 列出消息文件
	V1ThreadsThreadIdMessagesMessageIdFilesGet(c *gin.Context)

	// V1ThreadsThreadIdMessagesMessageIdGet Get /v1/threads/:thread_id/messages/:message_id
	// 检索消息
	V1ThreadsThreadIdMessagesMessageIdGet(c *gin.Context)

	// V1ThreadsThreadIdMessagesMessageIdPost Post /v1/threads/:thread_id/messages/:message_id
	// 修改留言
	V1ThreadsThreadIdMessagesMessageIdPost(c *gin.Context)

	// V1ThreadsThreadIdMessagesPost Post /v1/threads/:thread_id/messages
	// 创建消息
	V1ThreadsThreadIdMessagesPost(c *gin.Context)
}

type ModelsAPI

type ModelsAPI interface {

	// V1ModelsGet Get /v1/models
	// 列出模型
	V1ModelsGet(c *gin.Context)

	// V1ModelsModelGet Get /v1/models/:model
	// 删除微调模型
	V1ModelsModelGet(c *gin.Context)

	// V1ModelsModelidGet Get /v1/models/:modelid
	// 检索模型
	V1ModelsModelidGet(c *gin.Context)
}

type ModerationsAPI

type ModerationsAPI interface {

	// V1ModerationsPost Post /v1/moderations
	// 创建内容审核
	V1ModerationsPost(c *gin.Context)
}

type Route

type Route struct {
	// Name is the name of this Route.
	Name string
	// Method is the string for the HTTP method. ex) GET, POST etc..
	Method string
	// Pattern is the pattern of the URI.
	Pattern string
	// HandlerFunc is the handler function of this route.
	HandlerFunc gin.HandlerFunc
}

Route is the information for every URI.

type RunsAPI

type RunsAPI interface {

	// V1ThreadsRunsPost Post /v1/threads/runs
	// 创建线程并运行
	V1ThreadsRunsPost(c *gin.Context)

	// V1ThreadsThreadIdRunsGet Get /v1/threads/:thread_id/runs
	// 列表运行
	V1ThreadsThreadIdRunsGet(c *gin.Context)

	// V1ThreadsThreadIdRunsPost Post /v1/threads/:thread_id/runs
	// 创建运行
	V1ThreadsThreadIdRunsPost(c *gin.Context)

	// V1ThreadsThreadIdRunsRunIdCancelPost Post /v1/threads/:thread_id/runs/:run_id/cancel
	// 取消运行
	V1ThreadsThreadIdRunsRunIdCancelPost(c *gin.Context)

	// V1ThreadsThreadIdRunsRunIdGet Get /v1/threads/:thread_id/runs/:run_id
	// 修改运行
	V1ThreadsThreadIdRunsRunIdGet(c *gin.Context)

	// V1ThreadsThreadIdRunsRunIdStepsGet Get /v1/threads/:thread_id/runs/:run_id/steps
	// 列出运行步骤
	V1ThreadsThreadIdRunsRunIdStepsGet(c *gin.Context)

	// V1ThreadsThreadIdRunsRunIdStepsStepIdGet Get /v1 /threads/:thread_id/runs/:run_id/steps/:step_id
	// 检索运行步骤
	V1ThreadsThreadIdRunsRunIdStepsStepIdGet(c *gin.Context)

	// V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost Post /v1/threads/:thread_id/runs/:run_id/submit_tool_outputs
	// 提交工具输出以运行
	V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost(c *gin.Context)
}

type ThreadsAPI

type ThreadsAPI interface {

	// V1ThreadsPost Post /v1/threads
	// 创建线程
	V1ThreadsPost(c *gin.Context)

	// V1ThreadsThreadIdDelete Delete /v1/threads/:thread_id
	// 删除话题
	V1ThreadsThreadIdDelete(c *gin.Context)

	// V1ThreadsThreadIdPost Post /v1/threads/:thread_id
	// 修改线程
	V1ThreadsThreadIdPost(c *gin.Context)
}

type V1AssistantsAssistantIdFilesGet200Response

type V1AssistantsAssistantIdFilesGet200Response struct {
	Object string `json:"object"`

	Data []V1AssistantsAssistantIdFilesGet200ResponseDataInner `json:"data"`

	FirstId string `json:"first_id"`

	LastId string `json:"last_id"`

	HasMore bool `json:"has_more"`
}

type V1AssistantsAssistantIdFilesGet200ResponseDataInner

type V1AssistantsAssistantIdFilesGet200ResponseDataInner struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	AssistantId string `json:"assistant_id"`
}

type V1AssistantsAssistantIdPostRequest

type V1AssistantsAssistantIdPostRequest struct {

	// 要使用的模型的 ID。您可以使用列表模型API 查看所有可用模型,或查看我们的模型概述以获取它们的描述。
	Model string `json:"model,omitempty"`

	// 助理的名字。最大长度为 256 个字符。
	Name string `json:"name,omitempty"`

	// 助理的描述。最大长度为 512 个字符。
	Description string `json:"description,omitempty"`

	// 助手使用的系统指令。最大长度为 32768 个字符。
	Instructions string `json:"instructions,omitempty"`

	// 助手上启用的工具列表。每个助手最多可以有 128 个工具。工具的类型可以是code_interpreter、retrieval、 或function。
	Tools []V1AssistantsPostRequestToolsInner `json:"tools,omitempty"`

	// 附加到该助手的文件ID列表。助手最多可以附加 20 个文件。文件按其创建日期升序排列。如果某个文件之前已附加到列表但未显示在列表中,则该文件将从助手中删除。
	FileIds []string `json:"file_ids,omitempty"`

	// 一组可附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息非常有用。键的最大长度为 64 个字符,值的最大长度为 512 个字符。
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type V1AssistantsGet200Response

type V1AssistantsGet200Response struct {
	Object string `json:"object"`

	Data []V1AssistantsGet200ResponseDataInner `json:"data"`

	FirstId string `json:"first_id"`

	LastId string `json:"last_id"`

	HasMore bool `json:"has_more"`
}

type V1AssistantsGet200ResponseDataInner

type V1AssistantsGet200ResponseDataInner struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	Name *string `json:"name"`

	Model string `json:"model"`

	Instructions *string `json:"instructions"`

	Tools []string `json:"tools"`

	FileIds []string `json:"file_ids"`

	Metadata map[string]interface{} `json:"metadata"`
}

type V1AssistantsPost200Response

type V1AssistantsPost200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	Name string `json:"name"`

	Model string `json:"model"`

	Instructions string `json:"instructions"`

	Tools []V1AssistantsPost200ResponseToolsInner `json:"tools"`

	FileIds []string `json:"file_ids"`

	Metadata map[string]interface{} `json:"metadata"`
}

type V1AssistantsPost200ResponseToolsInner

type V1AssistantsPost200ResponseToolsInner struct {
	Type string `json:"type,omitempty"`
}

type V1AssistantsPostRequest

type V1AssistantsPostRequest struct {

	// 要使用的模型的 ID。您可以使用列表模型API 查看所有可用模型,或查看我们的模型概述以获取它们的描述。
	Model string `json:"model"`

	// 助理的名字。最大长度为 256 个字符。
	Name string `json:"name,omitempty"`

	// 助理的描述。最大长度为 512 个字符。
	Description string `json:"description,omitempty"`

	// 助手使用的系统指令。最大长度为 32768 个字符。
	Instructions string `json:"instructions,omitempty"`

	// 助手上启用的工具列表。每个助手最多可以有 128 个工具。工具的类型可以是`code_interpreter`、`retrieval`、 或`function`。
	Tools []V1AssistantsPostRequestToolsInner `json:"tools,omitempty"`

	// 附加到该助手的文件ID列表。助手最多可以附加 20 个文件。文件按其创建日期升序排列。
	FileIds []string `json:"file_ids,omitempty"`

	// 一组可附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息非常有用。键的最大长度为 64 个字符,值的最大长度为 512 个字符。
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type V1AssistantsPostRequestToolsInner

type V1AssistantsPostRequestToolsInner struct {

	// 正在定义的工具类型:code_interpreter
	Type string `json:"type,omitempty"`
}

type V1AudioSpeechGetRequest

type V1AudioSpeechGetRequest struct {

	// 可用的 TTS 模型之一:tts-1 或 tts-1-hd
	Model string `json:"model"`

	// 要生成音频的文本。最大长度为4096个字符。
	Input string `json:"input"`

	// 生成音频时使用的语音。支持的语音有:alloy、echo、fable、onyx、nova 和 shimmer。
	Voice string `json:"voice"`

	// 默认为 mp3 音频的格式。支持的格式有:mp3、opus、aac 和 flac。
	ResponseFormat string `json:"response_format,omitempty"`

	// 默认为 1 生成的音频速度。选择0.25到4.0之间的值。1.0是默认值。
	Speed float32 `json:"speed,omitempty"`
}

type V1AudioTranscriptionsGet200Response

type V1AudioTranscriptionsGet200Response struct {
	Text string `json:"text"`
}

type V1ChatCompletionsPost200Response

type V1ChatCompletionsPost200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	Created int32 `json:"created"`

	Choices []V1ChatCompletionsPost200ResponseChoicesInner `json:"choices"`

	Usage V1ChatCompletionsPost200ResponseUsage `json:"usage,omitempty"`
}

type V1ChatCompletionsPost200ResponseChoicesInner

type V1ChatCompletionsPost200ResponseChoicesInner struct {
	Index int32 `json:"index,omitempty"`

	Delta V1ChatCompletionsPost200ResponseChoicesInnerDelta `json:"delta,omitempty"`

	FinishReason string `json:"finish_reason,omitempty"`
}

type V1ChatCompletionsPost200ResponseChoicesInnerDelta

type V1ChatCompletionsPost200ResponseChoicesInnerDelta struct {
	Role string `json:"role"`

	Content string `json:"content"`
}

type V1ChatCompletionsPost200ResponseChoicesInnerMessage

type V1ChatCompletionsPost200ResponseChoicesInnerMessage struct {
	Role string `json:"role"`

	Content string `json:"content"`
}

type V1ChatCompletionsPost200ResponseUsage

type V1ChatCompletionsPost200ResponseUsage struct {
	PromptTokens int32 `json:"prompt_tokens"`

	CompletionTokens int32 `json:"completion_tokens"`

	TotalTokens int32 `json:"total_tokens"`
}

type V1ChatCompletionsPostRequest

type V1ChatCompletionsPostRequest struct {

	// 要使用的模型的 ID。有关哪些模型可与聊天 API 一起使用的详细信息,请参阅模型端点兼容性表。
	Model string `json:"model"`

	// 至今为止对话所包含的消息列表。Python 代码示例。
	Messages []V1ChatCompletionsPostRequestMessagesInner `json:"messages"`

	// 使用什么采样温度,介于 0 和 2 之间。较高的值(如 0.8)将使输出更加随机,而较低的值(如 0.2)将使输出更加集中和确定。  我们通常建议改变这个或`top_p`但不是两者。
	Temperature float32 `json:"temperature,omitempty"`

	// 一种替代温度采样的方法,称为核采样,其中模型考虑具有 top_p 概率质量的标记的结果。所以 0.1 意味着只考虑构成前 10% 概率质量的标记。  我们通常建议改变这个或`temperature`但不是两者。
	TopP int32 `json:"top_p,omitempty"`

	// 默认为 1 为每个输入消息生成多少个聊天补全选择。
	N int32 `json:"n,omitempty"`

	// 默认为 false 如果设置,则像在 ChatGPT 中一样会发送部分消息增量。标记将以仅数据的服务器发送事件的形式发送,这些事件在可用时,并在 data: [DONE] 消息终止流。Python 代码示例。
	Stream bool `json:"stream,omitempty"`

	// 默认为 null 最多 4 个序列,API 将停止进一步生成标记。
	Stop string `json:"stop,omitempty"`

	// 默认为 inf 在聊天补全中生成的最大标记数。  输入标记和生成标记的总长度受模型的上下文长度限制。计算标记的 Python 代码示例。
	MaxTokens int32 `json:"max_tokens,omitempty"`

	// -2.0 和 2.0 之间的数字。正值会根据到目前为止是否出现在文本中来惩罚新标记,从而增加模型谈论新主题的可能性。  [查看有关频率和存在惩罚的更多信息。](https://platform.openai.com/docs/api-reference/parameter-details)
	PresencePenalty float32 `json:"presence_penalty,omitempty"`

	// 默认为 0 -2.0 到 2.0 之间的数字。正值根据文本目前的存在频率惩罚新标记,降低模型重复相同行的可能性。  有关频率和存在惩罚的更多信息。
	FrequencyPenalty float32 `json:"frequency_penalty,omitempty"`

	// 代表您的最终用户的唯一标识符,可以帮助 OpenAI 监控和检测滥用行为。[了解更多](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids)。
	User string `json:"user,omitempty"`

	// 指定模型必须输出的格式的对象。  将 { \"type\": \"json_object\" } 启用 JSON 模式,这可以确保模型生成的消息是有效的 JSON。  重要提示:使用 JSON 模式时,还必须通过系统或用户消息指示模型生成 JSON。如果不这样做,模型可能会生成无休止的空白流,直到生成达到令牌限制,从而导致延迟增加和请求“卡住”的外观。另请注意,如果 finish_reason=\"length\",则消息内容可能会被部分切断,这表示生成超过了 max_tokens 或对话超过了最大上下文长度。  显示属性
	ResponseFormat map[string]interface{} `json:"response_format,omitempty"`

	// 此功能处于测试阶段。如果指定,我们的系统将尽最大努力确定性地进行采样,以便使用相同的种子和参数进行重复请求应返回相同的结果。不能保证确定性,您应该参考 system_fingerprint 响应参数来监控后端的更改。
	Seen int32 `json:"seen,omitempty"`

	// 模型可以调用的一组工具列表。目前,只支持作为工具的函数。使用此功能来提供模型可以为之生成 JSON 输入的函数列表。
	Tools []string `json:"tools,omitempty"`

	// 控制模型调用哪个函数(如果有的话)。none 表示模型不会调用函数,而是生成消息。auto 表示模型可以在生成消息和调用函数之间进行选择。通过 {\"type\": \"function\", \"function\": {\"name\": \"my_function\"}} 强制模型调用该函数。  如果没有函数存在,默认为 none。如果有函数存在,默认为 auto。  显示可能的类型
	ToolChoice map[string]interface{} `json:"tool_choice,omitempty"`
}

type V1ChatCompletionsPostRequestMessagesInner

type V1ChatCompletionsPostRequestMessagesInner struct {
	Role string `json:"role,omitempty"`

	Content string `json:"content,omitempty"`
}

type V1CompletionsPost200Response

type V1CompletionsPost200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	Created int32 `json:"created"`

	Model string `json:"model"`

	SystemFingerprint string `json:"system_fingerprint"`

	Choices []V1CompletionsPost200ResponseChoicesInner `json:"choices"`

	Usage V1ChatCompletionsPost200ResponseUsage `json:"usage"`
}

type V1CompletionsPost200ResponseChoicesInner

type V1CompletionsPost200ResponseChoicesInner struct {
	Text string `json:"text,omitempty"`

	Index int32 `json:"index,omitempty"`

	FinishReason string `json:"finish_reason,omitempty"`
}

type V1CompletionsPostRequest

type V1CompletionsPostRequest struct {

	// 要使用的模型的 ID。您可以使用[List models](https://platform.openai.com/docs/api-reference/models/list) API 来查看所有可用模型,或查看我们的[模型概述](https://platform.openai.com/docs/models/overview)以了解它们的描述。
	Model string `json:"model"`

	// 生成完成的提示,编码为字符串、字符串数组、标记数组或标记数组数组。  请注意,<|endoftext|> 是模型在训练期间看到的文档分隔符,因此如果未指定提示,模型将生成新文档的开头。
	Prompt string `json:"prompt"`

	// 默认为1 在服务器端生成best_of个补全,并返回“最佳”补全(每个令牌的日志概率最高的那个)。无法流式传输结果。  与n一起使用时,best_of控制候选补全的数量,n指定要返回的数量 – best_of必须大于n。  注意:因为这个参数会生成许多补全,所以它可以快速消耗您的令牌配额。请谨慎使用,并确保您对max_tokens和stop有合理的设置。
	BestOf int32 `json:"best_of,omitempty"`

	// 默认为false 除了补全之外,还回显提示
	Echo bool `json:"echo,omitempty"`

	// 默认为0 -2.0和2.0之间的数字。正值根据文本目前的现有频率处罚新令牌,降低模型逐字重复相同行的可能性。
	FrequencyPenalty float32 `json:"frequency_penalty,omitempty"`

	// 默认为null 修改完成中指定令牌出现的可能性。  接受一个JSON对象,该对象将令牌(由GPT令牌化器中的令牌ID指定)映射到关联偏差值,-100到100。您可以使用这个令牌化器工具(适用于GPT-2和GPT-3)将文本转换为令牌ID。从数学上讲,偏差在对模型进行采样之前添加到生成的logit中。确切效果因模型而异,但-1至1之间的值应降低或提高选择的可能性;像-100或100这样的值应导致相关令牌的禁用或专属选择。  例如,您可以传递{\"50256\": -100}来防止生成<|endoftext|>令牌。
	LogitBias map[string]interface{} `json:"logit_bias,omitempty"`

	// 默认为16 在补全中生成的最大令牌数。  提示的令牌计数加上max_tokens不能超过模型的上下文长度。 计数令牌的Python代码示例。
	MaxTokens int32 `json:"max_tokens,omitempty"`

	// 默认为1 为每个提示生成的补全数量。  注意:因为这个参数会生成许多补全,所以它可以快速消耗您的令牌配额。请谨慎使用,并确保您对max_tokens和stop有合理的设置。
	N int32 `json:"n,omitempty"`

	// 默认为0 -2.0和2.0之间的数字。正值根据它们是否出现在目前的文本中来惩罚新令牌,增加模型讨论新话题的可能性。  有关频率和存在惩罚的更多信息,请参阅。
	PresencePenalty float32 `json:"presence_penalty,omitempty"`

	// 如果指定,我们的系统将尽最大努力确定性地进行采样,以便使用相同的种子和参数的重复请求应返回相同的结果。  不保证确定性,您应该参考system_fingerprint响应参数来监视后端的更改。
	Seed int32 `json:"seed,omitempty"`

	// 默认为null 最多4个序列,API将停止在其中生成更多令牌。返回的文本不会包含停止序列。
	Stop string `json:"stop,omitempty"`

	// 默认为false 是否流回部分进度。如果设置,令牌将作为可用时发送为仅数据的服务器发送事件,流由数据 Terminated by a data: [DONE] message. 对象消息终止。 Python代码示例。
	Stream bool `json:"stream,omitempty"`

	// 默认为null 在插入文本的补全之后出现的后缀。
	Suffix string `json:"suffix,omitempty"`

	// 默认为1 要使用的采样温度,介于0和2之间。更高的值(如0.8)将使输出更随机,而更低的值(如0.2)将使其更集中和确定。  我们通常建议更改这个或top_p,而不是两者都更改。
	Temperature int32 `json:"temperature,omitempty"`

	User string `json:"user"`

	// 表示最终用户的唯一标识符,这可以帮助OpenAI监控和检测滥用。 了解更多。
	TopP int32 `json:"top_p,omitempty"`
}

type V1EmbeddingsPost200Response

type V1EmbeddingsPost200Response struct {
	Object string `json:"object"`

	Data []V1EmbeddingsPost200ResponseDataInner `json:"data"`

	Model string `json:"model"`

	Usage V1EmbeddingsPost200ResponseUsage `json:"usage"`
}

type V1EmbeddingsPost200ResponseDataInner

type V1EmbeddingsPost200ResponseDataInner struct {
	Object string `json:"object,omitempty"`

	Embedding []float32 `json:"embedding,omitempty"`

	Index int32 `json:"index,omitempty"`
}

type V1EmbeddingsPost200ResponseUsage

type V1EmbeddingsPost200ResponseUsage struct {
	PromptTokens int32 `json:"prompt_tokens"`

	TotalTokens int32 `json:"total_tokens"`
}

type V1EmbeddingsPostRequest

type V1EmbeddingsPostRequest struct {

	// 要使用的模型的 ID。您可以使用[List models](https://platform.openai.com/docs/api-reference/models/list) API 来查看所有可用模型,或查看我们的[模型概述](https://platform.openai.com/docs/models/overview)以了解它们的描述。
	Model string `json:"model"`

	// 输入文本以获取嵌入,编码为字符串或标记数组。要在单个请求中获取多个输入的嵌入,请传递一个字符串数组或令牌数组数组。每个输入的长度不得超过 8192 个标记。
	Input string `json:"input"`
}

type V1FilesFileIdDelete200Response

type V1FilesFileIdDelete200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	Deleted bool `json:"deleted"`
}

type V1FilesGet200Response

type V1FilesGet200Response struct {
	Data []V1FilesPost200Response `json:"data"`

	Object string `json:"object"`
}

type V1FilesPost200Response

type V1FilesPost200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	Bytes int32 `json:"bytes"`

	CreatedAt int32 `json:"created_at"`

	Filename string `json:"filename"`

	Purpose string `json:"purpose"`
}

type V1FineTuningJobsFineTuningJobIdCancelPost200Response

type V1FineTuningJobsFineTuningJobIdCancelPost200Response struct {

	// 对象类型,总是为\"fine_tuning.job\"
	Object string `json:"object"`

	// 对象标识符,可以在API端点中引用
	Id string `json:"id"`

	// 被微调的基础模型
	Model string `json:"model"`

	// 创建微调作业的Unix时间戳(秒)
	CreatedAt int32 `json:"created_at"`

	// 拥有微调作业的组织
	OrganizationId string `json:"organization_id"`

	// 微调作业的编译结果文件ID。可以使用文件API检索结果
	ResultFiles []string `json:"result_files"`

	Hyperparameters V1FineTuningJobsFineTuningJobIdCancelPost200ResponseHyperparameters `json:"hyperparameters"`

	// 微调作业的当前状态,可以是validating_files、queued、running、succeeded、failed或cancelled
	Status string `json:"status"`

	// 用于验证的文件ID。可以使用文件API检索验证结果
	ValidationFile string `json:"validation_file"`

	// 用于训练的文件ID。可以使用文件API检索训练数据
	TrainingFile string `json:"training_file"`
}

type V1FineTuningJobsFineTuningJobIdCancelPost200ResponseHyperparameters

type V1FineTuningJobsFineTuningJobIdCancelPost200ResponseHyperparameters struct {
	NEpochs string `json:"n_epochs"`
}

V1FineTuningJobsFineTuningJobIdCancelPost200ResponseHyperparameters - 微调作业使用的超参数。更多详细信息请参阅微调指南

type V1FineTuningJobsFineTuningJobIdEventsGet200Response

type V1FineTuningJobsFineTuningJobIdEventsGet200Response struct {

	// 对象类型,总是为\"fine_tuning.job\"
	Object string `json:"object"`

	Data []V1FineTuningJobsFineTuningJobIdEventsGet200ResponseDataInner `json:"data"`

	HasMore bool `json:"has_more"`
}

type V1FineTuningJobsFineTuningJobIdEventsGet200ResponseDataInner

type V1FineTuningJobsFineTuningJobIdEventsGet200ResponseDataInner struct {
	Object string `json:"object"`

	Id string `json:"id"`

	CreatedAt int32 `json:"created_at"`

	Level string `json:"level"`

	Message string `json:"message"`

	Type string `json:"type"`
}

type V1FineTuningJobsFineTuningJobIdGet200Response

type V1FineTuningJobsFineTuningJobIdGet200Response struct {

	// 对象类型,总是为\"fine_tuning.job\"
	Object string `json:"object"`

	// 对象标识符,可以在API端点中引用
	Id string `json:"id"`

	// 被微调的基础模型
	Model string `json:"model"`

	// 创建微调作业的Unix时间戳(秒)
	CreatedAt int32 `json:"created_at"`

	// 微调作业完成的Unix时间戳(秒)。如果微调作业仍在运行,则值为null
	FinishedAt int32 `json:"finished_at"`

	// 正在创建的微调模型的名称。如果微调作业仍在运行,则值为null
	FineTunedModel string `json:"fine_tuned_model"`

	// 拥有微调作业的组织
	OrganizationId string `json:"organization_id"`

	// 微调作业的编译结果文件ID。可以使用文件API检索结果
	ResultFiles []string `json:"result_files"`

	// 微调作业的当前状态,可以是validating_files、queued、running、succeeded、failed或cancelled
	Status string `json:"status"`

	// 用于训练的文件ID。可以使用文件API检索训练数据
	TrainingFile string `json:"training_file"`

	Hyperparameters V1FineTuningJobsFineTuningJobIdGet200ResponseHyperparameters `json:"hyperparameters"`

	// 此微调作业处理的计费标记总数。如果微调作业仍在运行,则值为null
	TrainedTokens int32 `json:"trained_tokens"`
}

type V1FineTuningJobsFineTuningJobIdGet200ResponseHyperparameters

type V1FineTuningJobsFineTuningJobIdGet200ResponseHyperparameters struct {
	NEpochs int32 `json:"n_epochs"`
}

V1FineTuningJobsFineTuningJobIdGet200ResponseHyperparameters - 微调作业使用的超参数。更多详细信息请参阅微调指南

type V1FineTuningJobsGet200Response

type V1FineTuningJobsGet200Response struct {

	// 对象类型,总是为\"fine_tuning.job\"
	Object string `json:"object"`

	Data []V1FineTuningJobsGet200ResponseDataInner `json:"data"`

	HasMore bool `json:"has_more"`
}

type V1FineTuningJobsGet200ResponseDataInner

type V1FineTuningJobsGet200ResponseDataInner struct {
	Object string `json:"object,omitempty"`

	Id string `json:"id,omitempty"`

	CreatedAt int32 `json:"created_at,omitempty"`

	Level string `json:"level,omitempty"`

	Message string `json:"message,omitempty"`

	Type string `json:"type,omitempty"`
}

type V1FineTuningJobsPost200Response

type V1FineTuningJobsPost200Response struct {

	// 对象类型,总是为\"fine_tuning.job\"
	Object string `json:"object"`

	// 对象标识符,可以在API端点中引用
	Id string `json:"id"`

	// 被微调的基础模型
	Model string `json:"model"`

	// 创建微调作业的Unix时间戳(秒)
	CreatedAt int32 `json:"created_at"`

	// 拥有微调作业的组织
	OrganizationId string `json:"organization_id"`

	// 微调作业的编译结果文件ID。可以使用文件API检索结果
	ResultFiles []string `json:"result_files"`

	// 微调作业的当前状态,可以是validating_files、queued、running、succeeded、failed或cancelled
	Status string `json:"status"`

	// 用于训练的文件ID。可以使用文件API检索训练数据
	TrainingFile string `json:"training_file"`
}

type V1FineTuningJobsPostRequest

type V1FineTuningJobsPostRequest struct {

	// 包含训练数据的上传文件的 ID。  有关如何上传文件的信息,请参阅[上传文件。](https://platform.openai.com/docs/api-reference/files/upload)  您的数据集必须格式化为 JSONL 文件。此外,您必须上传带有目的的文件`fine-tune`。  有关更多详细信息,请参阅[微调指南。](https://platform.openai.com/docs/guides/fine-tuning)
	TrainingFile string `json:"training_file"`

	// 要微调的模型的名称。您可以选择支持的模型之一。
	Model string `json:"model"`

	Hyperparameters V1FineTuningJobsPostRequestHyperparameters `json:"hyperparameters,omitempty"`

	// 最多 18 个字符的字符串,将添加到您的微调模型名称中。  例如,`suffix`“custom-model-name”的 a 将生成类似 的模型名称`ft:gpt-3.5-turbo:openai:custom-model-name:7p4lURel`。
	Suffix string `json:"suffix"`

	// 如果您提供此文件,则数据将用于在微调期间定期生成验证指标。这些指标可以在微调结果文件中查看。相同的数据不应同时出现在训练文件和验证文件中。  您的数据集必须格式化为 JSONL 文件。您必须以特定目的上传文件`fine-tune`。  有关更多详细信息,请参阅[微调指南。](https://platform.openai.com/docs/guides/fine-tuning)
	ValidationFile string `json:"validation_file"`
}

type V1FineTuningJobsPostRequestHyperparameters

type V1FineTuningJobsPostRequestHyperparameters struct {

	// 每批中的示例数。批量大小越大意味着模型参数的更新频率越低,但方差越小。
	BatchSize string `json:"batch_size,omitempty"`

	// 学习率的比例因子。较小的学习率可能有助于避免过度拟合。
	LearningRateMultiplier string `json:"learning_rate_multiplier,omitempty"`

	// 训练模型的纪元数。一个纪元是指训练数据集的一个完整周期。
	NEpochs string `json:"n_epochs,omitempty"`
}

V1FineTuningJobsPostRequestHyperparameters - 用于微调工作的超参数。

type V1ImagesGenerationsPost200Response

type V1ImagesGenerationsPost200Response struct {
	Created int32 `json:"created"`

	Data []V1ImagesGenerationsPost200ResponseDataInner `json:"data"`
}

type V1ImagesGenerationsPost200ResponseDataInner

type V1ImagesGenerationsPost200ResponseDataInner struct {
	Url string `json:"url"`
}

type V1ImagesGenerationsPostRequest

type V1ImagesGenerationsPostRequest struct {

	// 所需图像的文本描述。最大长度为 1000 个字符。
	Prompt string `json:"prompt"`

	// 用于图像生成的模型。
	Model string `json:"model,omitempty"`

	// 要生成的图像数。必须介于 1 和 10 之间。
	N int32 `json:"n,omitempty"`

	// 将生成的图像的质量。`hd`创建具有更精细细节和更高一致性的图像。此参数仅支持`dall-e-3`.
	Quality string `json:"quality,omitempty"`

	// 返回生成的图像的格式。必须是 或url之一b64_json。
	ResponseFormat string `json:"response_format,omitempty"`

	// 生成图像的大小。必须是`256x256`、`512x512`或`1024x1024`for之一`dall-e-2`。对于模型来说,必须是`1024x1024`、`1792x1024`、 或之一。`1024x1792“dall-e-3`
	Style string `json:"style,omitempty"`

	// 生成图像的风格。必须是 或`vivid`之一`natural`。生动使模型倾向于生成超真实和戏剧性的图像。自然使模型生成更自然、不太真实的图像。此参数仅支持`dall-e-3`.
	User string `json:"user,omitempty"`

	// 生成图像的大小。必须是256x256、512x512或 1024x1024之一。
	Size string `json:"size,omitempty"`
}

type V1ModelsGet200Response

type V1ModelsGet200Response struct {
	Object string `json:"object"`

	Data []V1ModelsGet200ResponseDataInner `json:"data"`
}

type V1ModelsGet200ResponseDataInner

type V1ModelsGet200ResponseDataInner struct {
	Id string `json:"id"`

	Object string `json:"object"`

	Created int32 `json:"created"`

	OwnedBy string `json:"owned_by"`
}

type V1ModerationsPost200Response

type V1ModerationsPost200Response struct {

	// 审核任务的唯一标识符
	Id string `json:"id"`

	// 用于审核的模型
	Model string `json:"model"`

	// 审核结果的详细信息
	Results []V1ModerationsPost200ResponseResultsInner `json:"results"`
}

type V1ModerationsPost200ResponseResultsInner

type V1ModerationsPost200ResponseResultsInner struct {
	Categories V1ModerationsPost200ResponseResultsInnerCategories `json:"categories,omitempty"`

	CategoryScores V1ModerationsPost200ResponseResultsInnerCategoryScores `json:"category_scores,omitempty"`

	// 审核模型是否将输入内容标记为可疑内容
	Flagged bool `json:"flagged,omitempty"`
}

type V1ModerationsPost200ResponseResultsInnerCategories

type V1ModerationsPost200ResponseResultsInnerCategories struct {

	// 审核模型检测到是否存在仇恨言论
	Hate bool `json:"hate"`

	HateThreatening bool `json:"hate/threatening"`

	// 审核模型检测到是否存在自残内容
	SelfHarm bool `json:"self-harm"`

	// 审核模型检测到是否存在性内容
	Sexual bool `json:"sexual"`

	SexualMinors bool `json:"sexual/minors"`

	// 审核模型检测到是否存在暴力内容
	Violence bool `json:"violence"`

	ViolenceGraphic bool `json:"violence/graphic"`
}

V1ModerationsPost200ResponseResultsInnerCategories - 审核模型检测到的所有分类标签

type V1ModerationsPost200ResponseResultsInnerCategoryScores

type V1ModerationsPost200ResponseResultsInnerCategoryScores struct {

	// 审核模型对仇恨言论的得分
	Hate float32 `json:"hate"`

	HateThreatening float32 `json:"hate/threatening"`

	// 审核模型对自残内容的得分
	SelfHarm float32 `json:"self-harm"`

	// 审核模型对性内容的得分
	Sexual float32 `json:"sexual"`

	SexualMinors float32 `json:"sexual/minors"`

	// 审核模型对暴力内容的得分
	Violence float32 `json:"violence"`

	ViolenceGraphic float32 `json:"violence/graphic"`
}

V1ModerationsPost200ResponseResultsInnerCategoryScores - 审核模型对所有分类标签的得分

type V1ModerationsPostRequest

type V1ModerationsPostRequest struct {

	// 要分类的输入文本
	Input string `json:"input"`

	// 有两种内容审核模型可用:`text-moderation-stable`和`text-moderation-latest`。  默认值`text-moderation-latest`将随着时间的推移自动升级。这可确保您始终使用我们最准确的模型。如果您使用`text-moderation-stable`,我们将在更新模型之前提供提前通知。的准确度`text-moderation-stable`可能略低于 的准确度`text-moderation-latest`。
	Model string `json:"model"`
}

type V1ThreadsPost200Response

type V1ThreadsPost200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	Metadata map[string]interface{} `json:"metadata"`
}

type V1ThreadsPostRequest

type V1ThreadsPostRequest struct {

	// 用于启动线程的消息列表。
	Messages []V1ThreadsPostRequestMessagesInner `json:"messages,omitempty"`

	// 一组可附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息非常有用。键的最大长度为 64 个字符,值的最大长度为 512 个字符。
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type V1ThreadsPostRequestMessagesInner

type V1ThreadsPostRequestMessagesInner struct {

	// 创建消息的实体的角色。目前仅user支持。
	Role string `json:"role"`

	// 消息的内容。
	Content string `json:"content"`

	// 消息应使用的文件ID列表。一条消息最多可以附加 10 个文件。retrieval对于code_interpreter可以访问和使用文件的工具非常有用。
	FileIds string `json:"file_ids,omitempty"`

	// 一组可附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息非常有用。键的最大长度为 64 个字符,值的最大长度为 512 个字符。
	Metadata string `json:"metadata,omitempty"`
}

type V1ThreadsRunsPost200Response

type V1ThreadsRunsPost200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	AssistantId string `json:"assistant_id"`

	ThreadId string `json:"thread_id"`

	Status string `json:"status"`

	ExpiresAt int32 `json:"expires_at"`

	Model string `json:"model"`

	Instructions string `json:"instructions"`

	Tools []string `json:"tools"`

	FileIds []string `json:"file_ids"`

	Metadata map[string]interface{} `json:"metadata"`
}

type V1ThreadsRunsPostRequest

type V1ThreadsRunsPostRequest struct {

	// 用于执行此运行的助手的 ID 。
	AssistantId string `json:"assistant_id"`

	Thread V1ThreadsRunsPostRequestThread `json:"thread"`

	// 用于执行此运行的模型的 ID 。如果此处提供了值,它将覆盖与助手关联的模型。如果没有,将使用与助手关联的模型。
	Model string `json:"model,omitempty"`

	// 覆盖助手的默认系统消息。这对于修改每次运行的行为非常有用。
	Instructions string `json:"instructions,omitempty"`

	// 覆盖助手可用于此运行的工具。这对于修改每次运行的行为非常有用。
	Tools []string `json:"tools,omitempty"`

	// 一组可附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息非常有用。键的最大长度为 64 个字符,值的最大长度为 512 个字符。
	Metadata string `json:"metadata,omitempty"`
}

type V1ThreadsRunsPostRequestThread

type V1ThreadsRunsPostRequestThread struct {

	// 用于启动线程的消息列表。
	Messages []V1ThreadsRunsPostRequestThreadMessagesInner `json:"messages,omitempty"`

	// 一组可附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息非常有用。键的最大长度为 64 个字符,值的最大长度为 512 个字符。
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type V1ThreadsRunsPostRequestThreadMessagesInner

type V1ThreadsRunsPostRequestThreadMessagesInner struct {

	// 创建消息的实体的角色。目前仅user支持。
	Role string `json:"role"`

	// 消息的内容。
	Content string `json:"content"`

	// 消息应使用的文件ID列表。一条消息最多可以附加 10 个文件。retrieval对于code_interpreter可以访问和使用文件的工具非常有用。
	FileIds []string `json:"file_ids"`

	// 一组可附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息非常有用。键的最大长度为 64 个字符,值的最大长度为 512 个字符。
	Metadata map[string]interface{} `json:"metadata"`
}

type V1ThreadsThreadIdMessagesGet200Response

type V1ThreadsThreadIdMessagesGet200Response struct {
	Object string `json:"object"`

	Data []V1ThreadsThreadIdMessagesGet200ResponseDataInner `json:"data"`

	FirstId string `json:"first_id"`

	LastId string `json:"last_id"`

	HasMore bool `json:"has_more"`
}

type V1ThreadsThreadIdMessagesGet200ResponseDataInner

type V1ThreadsThreadIdMessagesGet200ResponseDataInner struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	ThreadId string `json:"thread_id"`

	Role string `json:"role"`

	Content []V1ThreadsThreadIdMessagesGet200ResponseDataInnerContentInner `json:"content"`

	FileIds []string `json:"file_ids"`

	Metadata map[string]interface{} `json:"metadata"`
}

type V1ThreadsThreadIdMessagesGet200ResponseDataInnerContentInner

type V1ThreadsThreadIdMessagesGet200ResponseDataInnerContentInner struct {
	Type string `json:"type"`

	Text V1ThreadsThreadIdMessagesGet200ResponseDataInnerContentInnerText `json:"text"`
}

type V1ThreadsThreadIdMessagesGet200ResponseDataInnerContentInnerText

type V1ThreadsThreadIdMessagesGet200ResponseDataInnerContentInnerText struct {
	Value string `json:"value"`

	Annotations []string `json:"annotations"`
}

type V1ThreadsThreadIdMessagesMessageIdFilesFileIdGet200Response

type V1ThreadsThreadIdMessagesMessageIdFilesFileIdGet200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	MessageId string `json:"message_id"`
}

type V1ThreadsThreadIdMessagesMessageIdFilesGet200Response

type V1ThreadsThreadIdMessagesMessageIdFilesGet200Response struct {
	Object string `json:"object"`

	Data []V1ThreadsThreadIdMessagesMessageIdFilesFileIdGet200Response `json:"data"`

	FirstId string `json:"first_id"`

	LastId string `json:"last_id"`

	HasMore bool `json:"has_more"`
}

type V1ThreadsThreadIdMessagesMessageIdGet200Response

type V1ThreadsThreadIdMessagesMessageIdGet200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	ThreadId string `json:"thread_id"`

	Role string `json:"role"`

	Content []V1ThreadsThreadIdMessagesMessageIdGet200ResponseContentInner `json:"content"`

	FileIds []string `json:"file_ids"`

	Metadata map[string]interface{} `json:"metadata"`
}

type V1ThreadsThreadIdMessagesMessageIdGet200ResponseContentInner

type V1ThreadsThreadIdMessagesMessageIdGet200ResponseContentInner struct {
	Type string `json:"type,omitempty"`

	Text V1ThreadsThreadIdMessagesGet200ResponseDataInnerContentInnerText `json:"text,omitempty"`
}

type V1ThreadsThreadIdMessagesMessageIdPost200Response

type V1ThreadsThreadIdMessagesMessageIdPost200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	ThreadId string `json:"thread_id"`

	Role string `json:"role"`

	Content []V1ThreadsThreadIdMessagesMessageIdGet200ResponseContentInner `json:"content"`

	FileIds []string `json:"file_ids"`

	Metadata V1ThreadsThreadIdPost200ResponseMetadata `json:"metadata"`
}

type V1ThreadsThreadIdMessagesMessageIdPostRequest

type V1ThreadsThreadIdMessagesMessageIdPostRequest struct {
	Metadata V1ThreadsThreadIdMessagesMessageIdPostRequestMetadata `json:"metadata"`
}

type V1ThreadsThreadIdMessagesMessageIdPostRequestMetadata

type V1ThreadsThreadIdMessagesMessageIdPostRequestMetadata struct {
	Modified string `json:"modified"`

	User string `json:"user"`
}

V1ThreadsThreadIdMessagesMessageIdPostRequestMetadata - 一组可附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息非常有用。键的最大长度为 64 个字符,值的最大长度为 512 个字符。

type V1ThreadsThreadIdMessagesPost200Response

type V1ThreadsThreadIdMessagesPost200Response struct {

	// 标识符,可以在 API 端点中引用。
	Id string `json:"id"`

	// 对象类型,始终为`thread.message`。
	Object string `json:"object"`

	// 创建消息时的 Unix 时间戳(以秒为单位)。
	CreatedAt int32 `json:"created_at"`

	// 该消息所属的线程ID 。
	ThreadId string `json:"thread_id"`

	// 产生消息的实体。`user`或之一`assistant`。
	Role string `json:"role"`

	// 文本和/或图像数组中的消息内容。
	Content []V1ThreadsThreadIdMessagesPost200ResponseContentInner `json:"content"`

	// 助手应使用的[文件](https://platform.openai.com/docs/api-reference/files)ID列表。对于可访问文件的检索和 code_interpreter 等工具很有用。一条消息最多可以附加 10 个文件。
	FileIds []string `json:"file_ids"`

	// 一组可附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息非常有用。键的最大长度为 64 个字符,值的最大长度为 512 个字符。
	Metadata map[string]interface{} `json:"metadata"`
}

type V1ThreadsThreadIdMessagesPost200ResponseContentInner

type V1ThreadsThreadIdMessagesPost200ResponseContentInner struct {

	// 总是image_file。
	Type string `json:"type,omitempty"`

	Text V1ThreadsThreadIdMessagesPost200ResponseContentInnerText `json:"text,omitempty"`
}

type V1ThreadsThreadIdMessagesPost200ResponseContentInnerText

type V1ThreadsThreadIdMessagesPost200ResponseContentInnerText struct {
	Value string `json:"value"`

	Annotations []string `json:"annotations"`
}

V1ThreadsThreadIdMessagesPost200ResponseContentInnerText - 作为消息一部分的文本内容。

type V1ThreadsThreadIdMessagesPostRequest

type V1ThreadsThreadIdMessagesPostRequest struct {

	// 创建消息的实体的角色。目前仅user支持。
	Role string `json:"role"`

	// 消息的内容。
	Content string `json:"content"`

	// 消息应使用的文件ID列表。一条消息最多可以附加 10 个文件。retrieval对于code_interpreter可以访问和使用文件的工具非常有用。
	FileIds []string `json:"file_ids,omitempty"`

	// 一组可附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息非常有用。键的最大长度为 64 个字符,值的最大长度为 512 个字符。
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type V1ThreadsThreadIdPost200Response

type V1ThreadsThreadIdPost200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	Metadata V1ThreadsThreadIdPost200ResponseMetadata `json:"metadata"`
}

type V1ThreadsThreadIdPost200ResponseMetadata

type V1ThreadsThreadIdPost200ResponseMetadata struct {
	Modified string `json:"modified"`

	User string `json:"user"`
}

type V1ThreadsThreadIdPostRequest

type V1ThreadsThreadIdPostRequest struct {
	Metadata V1ThreadsThreadIdPostRequestMetadata `json:"metadata,omitempty"`
}

type V1ThreadsThreadIdPostRequestMetadata

type V1ThreadsThreadIdPostRequestMetadata struct {
	Modified string `json:"modified,omitempty"`

	User string `json:"user,omitempty"`
}

V1ThreadsThreadIdPostRequestMetadata - 一组可附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息非常有用。键的最大长度为 64 个字符,值的最大长度为 512 个字符。

type V1ThreadsThreadIdRunsGet200Response

type V1ThreadsThreadIdRunsGet200Response struct {
	Object string `json:"object"`

	Data []V1ThreadsThreadIdRunsGet200ResponseDataInner `json:"data"`

	FirstId string `json:"first_id"`

	LastId string `json:"last_id"`

	HasMore bool `json:"has_more"`
}

type V1ThreadsThreadIdRunsGet200ResponseDataInner

type V1ThreadsThreadIdRunsGet200ResponseDataInner struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	AssistantId string `json:"assistant_id"`

	ThreadId string `json:"thread_id"`

	Status string `json:"status"`

	StartedAt int32 `json:"started_at"`

	CompletedAt int32 `json:"completed_at"`

	Model string `json:"model"`

	Tools []V1ThreadsThreadIdRunsGet200ResponseDataInnerToolsInner `json:"tools"`

	FileIds []string `json:"file_ids"`

	Metadata map[string]interface{} `json:"metadata"`
}

type V1ThreadsThreadIdRunsGet200ResponseDataInnerToolsInner

type V1ThreadsThreadIdRunsGet200ResponseDataInnerToolsInner struct {
	Type string `json:"type"`
}

type V1ThreadsThreadIdRunsPost200Response

type V1ThreadsThreadIdRunsPost200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	AssistantId string `json:"assistant_id"`

	ThreadId string `json:"thread_id"`

	Status string `json:"status"`

	StartedAt int32 `json:"started_at"`

	CompletedAt int32 `json:"completed_at"`

	Model string `json:"model"`

	Tools []V1AssistantsPost200ResponseToolsInner `json:"tools"`

	FileIds []string `json:"file_ids"`

	Metadata map[string]interface{} `json:"metadata"`
}

type V1ThreadsThreadIdRunsPostRequest

type V1ThreadsThreadIdRunsPostRequest struct {

	// 用于执行此运行的助手的 ID 。
	AssistantId string `json:"assistant_id"`

	// 用于执行此运行的模型的 ID 。如果此处提供了值,它将覆盖与助手关联的模型。如果没有,将使用与助手关联的模型。
	Model string `json:"model"`

	// 覆盖助手的默认系统消息。这对于修改每次运行的行为非常有用。
	Instructions string `json:"instructions"`

	// 覆盖助手可用于此运行的工具。这对于修改每次运行的行为非常有用。
	Tools []V1ThreadsThreadIdRunsPostRequestToolsInner `json:"tools,omitempty"`

	// 一组可附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息非常有用。键的最大长度为 64 个字符,值的最大长度为 512 个字符。
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type V1ThreadsThreadIdRunsPostRequestToolsInner

type V1ThreadsThreadIdRunsPostRequestToolsInner struct {
	CodeInterpreterTool V1ThreadsThreadIdRunsPostRequestToolsInnerCodeInterpreterTool `json:"Code interpreter tool,omitempty"`

	RetrievalTool V1ThreadsThreadIdRunsPostRequestToolsInnerRetrievalTool `json:"Retrieval tool,omitempty"`

	FunctionTool V1ThreadsThreadIdRunsPostRequestToolsInnerFunctionTool `json:"Function tool,omitempty"`
}

type V1ThreadsThreadIdRunsPostRequestToolsInnerCodeInterpreterTool

type V1ThreadsThreadIdRunsPostRequestToolsInnerCodeInterpreterTool struct {

	// 正在定义的工具类型:code_interpreter
	Type string `json:"type"`
}

type V1ThreadsThreadIdRunsPostRequestToolsInnerFunctionTool

type V1ThreadsThreadIdRunsPostRequestToolsInnerFunctionTool struct {

	// 正在定义的工具类型:function
	Type string `json:"type"`

	Function V1ThreadsThreadIdRunsPostRequestToolsInnerFunctionToolFunction `json:"function"`
}

type V1ThreadsThreadIdRunsPostRequestToolsInnerFunctionToolFunction

type V1ThreadsThreadIdRunsPostRequestToolsInnerFunctionToolFunction struct {

	// 对函数功能的描述,模型使用它来选择何时以及如何调用该函数。
	Description string `json:"description,omitempty"`

	// 要调用的函数的名称。必须是 az、AZ、0-9,或包含下划线和破折号,最大长度为 64。
	Name string `json:"name"`

	// 函数接受的参数,描述为 JSON Schema 对象。请参阅指南以获取示例,并参阅 JSON 架构参考以获取有关格式的文档。  要描述不接受参数的函数,请提供值{\"type\": \"object\", \"properties\": {}}。
	Parameters map[string]interface{} `json:"parameters"`
}

type V1ThreadsThreadIdRunsPostRequestToolsInnerRetrievalTool

type V1ThreadsThreadIdRunsPostRequestToolsInnerRetrievalTool struct {

	// 正在定义的工具类型:retrieval
	Type string `json:"type"`
}

type V1ThreadsThreadIdRunsRunIdCancelPost200Response

type V1ThreadsThreadIdRunsRunIdCancelPost200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	AssistantId string `json:"assistant_id"`

	ThreadId string `json:"thread_id"`

	Status string `json:"status"`

	StartedAt int32 `json:"started_at"`

	ExpiresAt int32 `json:"expires_at"`

	Model string `json:"model"`

	Instructions string `json:"instructions"`

	Tools []V1AssistantsPost200ResponseToolsInner `json:"tools"`

	FileIds []string `json:"file_ids"`

	Metadata map[string]interface{} `json:"metadata"`
}

type V1ThreadsThreadIdRunsRunIdGet200Response

type V1ThreadsThreadIdRunsRunIdGet200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	AssistantId string `json:"assistant_id"`

	ThreadId string `json:"thread_id"`

	Status string `json:"status"`

	StartedAt int32 `json:"started_at"`

	CompletedAt int32 `json:"completed_at"`

	Model string `json:"model"`

	Tools []V1AssistantsPost200ResponseToolsInner `json:"tools"`

	FileIds []string `json:"file_ids"`

	Metadata V1ThreadsThreadIdRunsRunIdGet200ResponseMetadata `json:"metadata"`
}

type V1ThreadsThreadIdRunsRunIdGet200ResponseMetadata

type V1ThreadsThreadIdRunsRunIdGet200ResponseMetadata struct {
	UserId string `json:"user_id"`
}

type V1ThreadsThreadIdRunsRunIdGetRequest

type V1ThreadsThreadIdRunsRunIdGetRequest struct {
	Metadata V1ThreadsThreadIdRunsRunIdGetRequestMetadata `json:"metadata,omitempty"`
}

type V1ThreadsThreadIdRunsRunIdGetRequestMetadata

type V1ThreadsThreadIdRunsRunIdGetRequestMetadata struct {
	UserId string `json:"user_id"`
}

V1ThreadsThreadIdRunsRunIdGetRequestMetadata - 一组可附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息非常有用。键的最大长度为 64 个字符,值的最大长度为 512 个字符。

type V1ThreadsThreadIdRunsRunIdStepsGet200Response

type V1ThreadsThreadIdRunsRunIdStepsGet200Response struct {
	Object string `json:"object"`

	Data []V1ThreadsThreadIdRunsRunIdStepsGet200ResponseDataInner `json:"data"`

	FirstId string `json:"first_id"`

	LastId string `json:"last_id"`

	HasMore bool `json:"has_more"`
}

type V1ThreadsThreadIdRunsRunIdStepsGet200ResponseDataInner

type V1ThreadsThreadIdRunsRunIdStepsGet200ResponseDataInner struct {
	Id string `json:"id,omitempty"`

	Object string `json:"object,omitempty"`

	CreatedAt int32 `json:"created_at,omitempty"`

	RunId string `json:"run_id,omitempty"`

	AssistantId string `json:"assistant_id,omitempty"`

	ThreadId string `json:"thread_id,omitempty"`

	Type string `json:"type,omitempty"`

	Status string `json:"status,omitempty"`

	CompletedAt int32 `json:"completed_at,omitempty"`

	StepDetails V1ThreadsThreadIdRunsRunIdStepsStepIdGet200ResponseStepDetails `json:"step_details,omitempty"`
}

type V1ThreadsThreadIdRunsRunIdStepsStepIdGet200Response

type V1ThreadsThreadIdRunsRunIdStepsStepIdGet200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	RunId string `json:"run_id"`

	AssistantId string `json:"assistant_id"`

	ThreadId string `json:"thread_id"`

	Type string `json:"type"`

	Status string `json:"status"`

	CompletedAt int32 `json:"completed_at"`

	StepDetails V1ThreadsThreadIdRunsRunIdStepsStepIdGet200ResponseStepDetails `json:"step_details"`
}

type V1ThreadsThreadIdRunsRunIdStepsStepIdGet200ResponseStepDetails

type V1ThreadsThreadIdRunsRunIdStepsStepIdGet200ResponseStepDetails struct {
	Type string `json:"type"`

	MessageCreation V1ThreadsThreadIdRunsRunIdStepsStepIdGet200ResponseStepDetailsMessageCreation `json:"message_creation"`
}

type V1ThreadsThreadIdRunsRunIdStepsStepIdGet200ResponseStepDetailsMessageCreation

type V1ThreadsThreadIdRunsRunIdStepsStepIdGet200ResponseStepDetailsMessageCreation struct {
	MessageId string `json:"message_id"`
}

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200Response

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200Response struct {
	Id string `json:"id"`

	Object string `json:"object"`

	CreatedAt int32 `json:"created_at"`

	AssistantId string `json:"assistant_id"`

	ThreadId string `json:"thread_id"`

	Status string `json:"status"`

	StartedAt int32 `json:"started_at"`

	ExpiresAt int32 `json:"expires_at"`

	Model string `json:"model"`

	Instructions string `json:"instructions"`

	Tools []V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200ResponseToolsInner `json:"tools"`

	FileIds []string `json:"file_ids"`

	Metadata map[string]interface{} `json:"metadata"`
}

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200ResponseToolsInner

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200ResponseToolsInner struct {
	Type string `json:"type,omitempty"`

	Function V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200ResponseToolsInnerFunction `json:"function,omitempty"`
}

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200ResponseToolsInnerFunction

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200ResponseToolsInnerFunction struct {
	Name string `json:"name"`

	Description string `json:"description"`

	Parameters V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200ResponseToolsInnerFunctionParameters `json:"parameters"`
}

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200ResponseToolsInnerFunctionParameters

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200ResponseToolsInnerFunctionParameters struct {
	Type string `json:"type"`

	Properties V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200ResponseToolsInnerFunctionParametersProperties `json:"properties"`

	Required []string `json:"required"`
}

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200ResponseToolsInnerFunctionParametersPropertiesLocation

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200ResponseToolsInnerFunctionParametersPropertiesLocation struct {
	Type string `json:"type"`

	Description string `json:"description"`
}

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200ResponseToolsInnerFunctionParametersPropertiesUnit

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPost200ResponseToolsInnerFunctionParametersPropertiesUnit struct {
	Type string `json:"type"`

	Enum []string `json:"enum"`
}

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPostRequest

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPostRequest struct {

	// 为其提交输出的工具列表。
	ToolOutputs []V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPostRequestToolOutputsInner `json:"tool_outputs"`
}

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPostRequestToolOutputsInner

type V1ThreadsThreadIdRunsRunIdSubmitToolOutputsPostRequestToolOutputsInner struct {

	// required_action正在提交输出的运行对象内的对象中的工具调用的 ID 。
	ToolCallId string `json:"tool_call_id,omitempty"`

	// 要提交以继续运行的工具调用的输出。
	Output string `json:"output,omitempty"`
}

Source Files

Jump to

Keyboard shortcuts

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