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

请求支持openai新模型gpt-4-turbo #1304

Closed
4 of 5 tasks
elonlo opened this issue Apr 12, 2024 · 4 comments
Closed
4 of 5 tasks

请求支持openai新模型gpt-4-turbo #1304

elonlo opened this issue Apr 12, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@elonlo
Copy link

elonlo commented Apr 12, 2024

例行检查

  • 我已确认目前没有类似 issue
  • 我已确认我已升级到最新版本
  • 我已完整查看过项目 README,尤其是常见问题部分
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

问题描述
支持Openai GPT-4 Turbo

复现步骤

预期结果

相关截图
image

@elonlo elonlo added the bug Something isn't working label Apr 12, 2024
@RexWzh
Copy link

RexWzh commented Apr 12, 2024

渠道模型那里,手动加上 gpt-4-turbo 就行了。亲测可用。

另外,”填入渠道支持模型“ 会填入默认写好的模型;能否增加一个选项,获取渠道 v1/models 接口返回的模型,这样项目不需要频繁维护这个模型列表(不过除了 OpenAI 其他API 的更新频率应该不高)。

curl $OPENAI_API_BASE/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-4-turbo",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "What'\''s in this image?"
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
            }
          }
        ]
      }
    ],
    "max_tokens": 300
  }'


{
  "id": "chatcmpl-9DAlsV4hpKvEkdpfxaWLppuhOUa45",
  "object": "chat.completion",
  "created": 1712926696,
  "model": "gpt-4-turbo-2024-04-09",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "This image features a beautiful natural landscape with a wooden boardwalk extending through a lush green meadow. The meadow is flanked by tall grasses and some scattered bushes, possibly hinting at a wetland or marshland environment. The sky above is clear with a few clouds, suggesting a sunny day. This scene is serene, and the boardwalk invites one to walk through and enjoy the tranquil surroundings. The overall picture is vibrant with rich green tones and a sense of peacefulness in a natural setting."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 1118,
    "completion_tokens": 102,
    "total_tokens": 1220
  },
  "system_fingerprint": "fp_d1bac968b4"
}

@songquanpeng
Copy link
Owner

@RexWzh 这个是有什么用途吗?目前 /v1/models 返回的是令牌所支持的渠道

@RexWzh
Copy link

RexWzh commented Apr 13, 2024

v1/models 的处理非常好了~
我指填写渠道时,载入的默认列表。如果每次openai更新模型,都要同步更新该表,可能有点琐碎(开发侧)

@songquanpeng
Copy link
Owner

点击这个可以直接补齐:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants