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

gpt-4o联网查询显示错误 #190

Open
ChthoIly opened this issue Nov 11, 2024 · 3 comments
Open

gpt-4o联网查询显示错误 #190

ChthoIly opened this issue Nov 11, 2024 · 3 comments

Comments

@ChthoIly
Copy link

如果查询问题经过chatgpt web版联网处理后好像会有一些格式和符合显示问题。

使用的最新版本地部署3298ebf

from openai import OpenAI
client = OpenAI()
client.api_key = "eyJhbGciOiJSUzICI6Ikp,2e182d"
client.base_url = "http://127.0.0.1:5005/v1"
completion = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "user", "content": "今天天气怎么样?"}
    ]
)

print(completion)

返回:

ChatCompletion(id='chatcmpl-mI5VMPrI', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content=' **[[""]]( "")** forecast\ue202turn0forecast0\ue201 **[[""]]( "")** 日),XXX的天气预报如下: **[[""]]( "")** \n\n **[[""]]( "")** - **白天**:大部分多云,微风,最高气温约14°C。 **[[""]]( "")** \n **[[""]]( "")** - **夜间**:
气温下降至约2°C。 **[[""]]( "")** \n\n请注意天气变化,适当增减衣物。 ', refusal=None, role='assistant', audio=None, function_call=None, tool_calls=None))], created=17362, model='gpt-4o-2024-05-13', object='chat.completion', service_tier=None, system_fingerprint='fp_3a7', usage=CompletionUsage(completion_tokens=123, prompt_tokens=12, total_tokens=135, completion_tokens_details=None, prompt_tokens_details=None))

显示效果:

[""] forecast\ue202turn0forecast0\ue201 [""] 日),XXX的天气预报如下: [""] \n\n [""] - 白天:大部分多云,微风,最高气温约14°C。 [""] \n [""] - 夜间
气温下降至约2°C。 [""] \n\n请注意天气变化,适当增减衣物。

@lanqian528
Copy link
Owner

看起来没问题呀

@ChthoIly
Copy link
Author

看起来没问题呀

**[[""]]( "")** forecast\ue202turn0forecast0\ue201 **[[""]]( "")** 日)
这部分是什么?正常显示应该不是这样的把?好像缺少了某种格式转换,没有像官网web版的正常显示内容。

我的理解有问题吗?

@Yanyutin753
Copy link
Contributor

api确实存在格式错误,估计还得重新抓请求分析

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants