lobehub / lobe-chat

🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers( OpenAI / Claude 3 / Gemini / Ollama / Azure / DeepSeek), Knowledge Base (file upload / knowledge management / RAG ), Multi-Modals (Vision/TTS) and plugin system. One-click FREE deployment of your private ChatGPT/ Claude application.
https://chat-preview.lobehub.com
Other
44.39k stars 9.95k forks source link

[Bug] openrouter api的模型无法支持fc #3346

Closed wangdake5111 closed 2 months ago

wangdake5111 commented 3 months ago

📦 Environment

Docker

📌 Version

v1.7.1

💻 Operating System

Ubuntu

🌐 Browser

Edge

🐛 Bug Description

openrouter api的模型无法支持fc(显然claude-3.5支持vision和fc,但是不会有图标显示,在对话界面也是直接不可以使用,是否是因为lobe-chat关于模型部分是硬编码?而openrouter的模型路径前面会带provider导致的),

CleanShot 2024-07-28 at 09 34 33@2x

如果我在OPENROUTER_CUSTOM_MODELS中手动打开,虽然可以访问插件,但是claude-3.5-sonnet模型依然会返回response.undefined image

📷 Recurrence Steps

No response

🚦 Expected Behavior

fix it

📝 Additional Information

No response

lobehubbot commented 3 months ago

👀 @wangdake5111

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

wangdake5111 commented 3 months ago

add

经过调整,虽然可以调用了,但是无法返回数据

Image

这是gpt会返回的

Image

lobehubbot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


add

After adjustment, although it can be called, data cannot be returned.

Image

This is what gpt will return

Image

shog86 commented 3 months ago

请问调整啥了?我vercel部署也有这问题

lobehubbot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


May I ask what has been adjusted? I also have this problem with my vercel deployment

wangdake5111 commented 3 months ago

请问调整啥了?我vercel部署也有这问题

手动打开models 的特性,你可以看看文档里关于 MODEL_LIST 的部分,比如=OPENROUTER_MODEL_LIST="+claude-3.5-sonnet<200000:fc:vision>"

但是手动打开依然无法正常使用插件,会调用但不会返回

lobehubbot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


What adjustments have been made? I also have this problem with my vercel deployment

To manually open the features of models, you can look at the part about MODEL_LIST in the document, for example =OPENROUTER_MODEL_LIST="+claude-3.5-sonnet<200000:fc:vision>"

However, if you open it manually, you still cannot use the plug-in normally. It will be called but will not return.

arvinxx commented 2 months ago

我试了下, OpenRouter 的 Claude Tools Calling 兼容度很有问题。暂时估计支持不了了

lobehubbot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I tried it and found that there is a problem with OpenRouter's Claude Tools Calling compatibility. It is estimated that it will not be supported for the time being.

arvinxx commented 2 months ago

和 #3269 重复

lobehubbot commented 2 months ago

✅ @wangdake5111

This issue is closed, If you have any questions, you can comment and reply.\ 此问题已经关闭。如果您有任何问题,可以留言并回复。

lobehubbot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Duplicate of #3269

shog86 commented 1 month ago

OpenRouter愿意帮忙排查一下,能辛苦你给个你测试的日志不? @arvinxx image

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


OpenRouter is willing to help troubleshoot. Can you please provide the logs of your tests? @arvinxx image

arvinxx commented 1 month ago

@shog86 我这周有给他们提过

it's about tools calling stream. OpenAI 's Tools Calling index start with 0, it likes:

{
  choices: [
    {
      delta: {
        tool_calls: [
          {
            function: { name: 'tool1', arguments: '{}' },
            id: 'call_1',
            index: 0,
            type: 'function',
          },
          {
            function: { name: 'tool2', arguments: '{}' },
            id: 'call_2',
            index: 1,
          },
        ],
      },
      index: 0,
    },
  ],
  id: '2',
}

but currently the Claude tools calling in OpenRouter is

{
  id: 'gen-Bx4R8TCbr4GElWZJtE30XGDQyoYW',
  model: 'anthropic/claude-3.5-sonnet',
  object: 'chat.completion.chunk',
  created: 1725817213,
  choices: [
    {
      delta: {
        role: 'assistant',
        content: null,
        tool_calls: [{ index: 1, type: 'function', function: { arguments: '{"city"' } }],
      },
      index: 0,
    },
  ],
},

if the index start with 1, it will hard to support

arvinxx commented 1 month ago

我周二跟他们反馈的,感觉没上心吧。image

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I gave them feedback on Tuesday, but I feel like they didn’t take it seriously. image

shog86 commented 1 month ago

我周二跟他们反馈的,感觉没上心吧。

他们说今天修复了!你有空了看看~

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I gave them feedback on Tuesday, but I don’t think they took it seriously.

They said it was fixed today! Take a look when you have time~

shog86 commented 1 month ago

试了一下,可以了 image image

lobehubbot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Tried it, it works image image

lobehubbot commented 1 month ago

:tada: This issue has been resolved in version 1.19.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: