Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

是否能支持如 text-davinci-003 等使用 /v1/completions api 的接口的模型? #115

Closed
zhiqiangwong opened this issue May 24, 2023 · 8 comments
Labels
enhancement New feature or request priority This will have high priority.

Comments

@zhiqiangwong
Copy link

一些模型使用的是旧版的接口,而目前 /v1/completions 接口是不支持的是否那个加上对这个接口的支持?

@songquanpeng songquanpeng added the enhancement New feature or request label May 24, 2023
@songquanpeng
Copy link
Owner

Okay,等这段时间忙完后处理。

@songquanpeng songquanpeng added the priority This will have high priority. label Jun 8, 2023
@songquanpeng
Copy link
Owner

可以给我几个使用该接口的应用的例子么?

@zhiqiangwong
Copy link
Author

zhiqiangwong commented Jun 8, 2023

Parameters:

{
  "model": "text-davinci-003",
  "prompt": "Say this is a test",
  "max_tokens": 7,
  "temperature": 0,
  "top_p": 1,
  "n": 1,
  "stream": false,
  "logprobs": null,
  "stop": "\n"
}

Response:

{
  "id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
  "object": "text_completion",
  "created": 1589478378,
  "model": "text-davinci-003",
  "choices": [
    {
      "text": "\n\nThis is indeed a test",
      "index": 0,
      "logprobs": null,
      "finish_reason": "length"
    }
  ],
  "usage": {
    "prompt_tokens": 5,
    "completion_tokens": 7,
    "total_tokens": 12
  }
}

@songquanpeng
Copy link
Owner

是需要用到该接口的应用的例子,而不是调用的示例。

这样方便之后测试。

@zhiqiangwong
Copy link
Author

这个接口是3.5之前的gpt模型接口,还有部分细分的模型,资费更为便宜,在某些场景下不需要用到3.5 或者 4,可以使用这个接口性价比更高。如我的应用需要根据用户输入内容识别用户意图,提供了可选项以及用户输入内容给 gpt 从中做出选择,由于调用频率较高,且本身只需要用到语义理解的能力,3.5之前的模型也同样具备,改为这类资费较低的模型性价比较高。

@songquanpeng
Copy link
Owner

了解了。

@songquanpeng
Copy link
Owner

已实现,不过我不明白为什么我的 response 中返回为空:
image

如果可以的话,请测试一下能否复现。

@songquanpeng
Copy link
Owner

已推送 v0.4.0-alpha.1

k8scat pushed a commit to k8scat/one-api that referenced this issue Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority This will have high priority.
Projects
None yet
Development

No branches or pull requests

2 participants