songquanpeng / one-api

OpenAI 接口管理 & 分发系统,支持 Azure、Anthropic Claude、Google PaLM 2 & Gemini、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问、360 智脑以及腾讯混元,可用于二次分发管理 key,仅单可执行文件,已打包好 Docker 镜像,一键部署,开箱即用. OpenAI key management & redistribution system, using a single API for all LLMs, and features an English UI.
https://openai.justsong.cn/
MIT License
18.26k stars 4.12k forks source link

支持 API 函数调用 #160

Open zhiqiangwong opened 1 year ago

zhiqiangwong commented 1 year ago

「凌晨,openai 带来了重磅更新: https://openai.com/blog/function-calling-and-other-api-updates

GPT3.5 模型价格下调 25%,embedding 模型价格下调 75%!

并新增 GPT3.5-16K 模型,同时支持函数调用接口。」

望尽早支持 gpt-3.5-turbo-16k 模型, 以及支持函数调用的 gpt-3.5-turbo-0613

songquanpeng commented 1 year ago

gpt-3.5-turbo-16k 刚刚已经支持了。

Ink-Osier commented 1 year ago

gpt-3.5-turbo-16k 刚刚已经支持了。

请问这个直接pull最新的latest镜像就可以了么,似乎拉取新镜像重建容器后并没有出现新的模型

songquanpeng commented 1 year ago

有哦: image

版本: image

Ink-Osier commented 1 year ago

有哦: image

版本: image

不好意思我的错,更新错了服务器了,更新了一个没有在用的服务器的oneapi(

Coder-Wjt commented 1 year ago

使用函数调用+stream组合的时候,好像并没有计算函数的token

songquanpeng commented 1 year ago

Okay,我今天晚上看一下吧(如果没有其他插入的事情。

deadnessking commented 1 year ago

Okay,我今天晚上看一下吧(如果没有其他插入的事情。

v0.5.3-alpha.1使用模型重定向功能或Azure账号的话会失去函数调用能力

shao0222 commented 1 year ago

Okay,我今天晚上看一下吧(如果没有其他插入的事情。

v0.5.3-alpha.1使用模型重定向功能或Azure账号的话会失去函数调用能力

我也碰见了,初步看上去是因为

type GeneralOpenAIRequest struct {
        Model       string    `json:"model,omitempty"`
        Messages    []Message `json:"messages,omitempty"`
        Prompt      any       `json:"prompt,omitempty"`
        Stream      bool      `json:"stream,omitempty"`
        MaxTokens   int       `json:"max_tokens,omitempty"`
        Temperature float64   `json:"temperature,omitempty"`
        TopP        float64   `json:"top_p,omitempty"`
        N           int       `json:"n,omitempty"`
        Input       any       `json:"input,omitempty"`
        Instruction string    `json:"instruction,omitempty"`
        Size        string    `json:"size,omitempty"`
}

这个里面缺少functions