调试 Discourse 的 AI 功能:OpenAI 回应,但论坛不回应

感谢您为 Discourse 开发 AI 功能!我认为这将是未来的一个重要功能。

我尝试在我们自托管的论坛 (tff-forum.de) 上使用 AI 插件。在管理员面板中添加 OpenAI API 密钥并为不同功能激活“gpt-3.5-turbo-16k”模型后,我可以在论坛的不同位置看到额外的 AI 按钮。

当我点击其中一个按钮时,要么没有任何返回,要么出现下图所示的错误消息。

我可以在 OpenAI 使用情况仪表板中看到 API 请求,但似乎 Discourse 没有收到响应。

我也尝试了其他模型(gpt-35、gpt-4 等)。结果总是相同的,即功能不提供任何响应。

Discourse 错误日志未显示有关 AI 功能的任何问题。

您能否提供有关如何调试或分析此问题的更多信息?

请在您的服务器上尝试以下说明。

1 个赞

感谢您提供用于检查 OpenAI API 功能的脚本。

我们在服务器上运行了该脚本,并从 gpt 得到了以下答案:

...
 {
 "index": 0,
 "message": {
 "role": "assistant",
 "content": "In the heart of the coded rhyme,
Behold, there’s a concept sublime.
It's recursion, an art, an ancient tradition,
Of a function calling itself, that's the mission.

A function so proud, will not heed the call,
Of any other, it stands tall.
It opts to invoke itself anew,
Thus, weaving patterns that intrigue view.

When it starts, you might suppose,
Where it ends, no one knows?
But fear, not the infinite loop,
For base case is our saving hoop.

Upon reaching the base so divinely small,
The function at last does forestall.
So, it stops and does not bind,
Returning what it's meant to find.

Who would make such hearty appeal?
An elegant way to seal the deal.
Solving mazes, or reversing strings,
See recursion spreading its wings.

Each instance has its memory stack,
To trace its way, front to back.
And as these instances grow,
A tower of memory, they bestow.

When done right, the harmony is pure,
Recursion’s charm, quite the lure.
It’s elegance, it’s profound autonomy,
A jewel in the crown of algorithms' ceremony.

It's a dance, it's a play, eternal reprise,
In the theater of codes, where recursion lies.
Behold the beauty, behold the excursion,
In the vast realm of code, that's the recursion."
 },
 "logprobs": null,
 "finish_reason": "stop"
 }
 ],
 "usage": {
 "prompt_tokens": 39,
 "completion_tokens": 282,
 "total_tokens": 321
 },
 "system_fingerprint": null
}

此调用似乎有效。但是,当我激活 Discourse AI 功能(例如“composer ai helper”)并使用相同的 OpenAI API 密钥时,要么没有响应,要么出现此线程第一个帖子中显示的错误消息。

是否有其他方法可以调试 OpenAI API 调用?

你更新到最新版本了吗?我们将 LLM 配置移到了一个单独的区域。

1 个赞

感谢您的支持。我们今天开始重建,现在基于 OpenAI API 的功能似乎可以正常工作了。

现在我发现了一个新问题。重建后,我无法在管理员设置中更改 OpenAI 模型。列表似乎是空的,但 Discourse 仍在使用我上次的设置“gpt-4o”。

image

这是已知问题吗?您认为再次重建可以解决它吗?

抱歉,我找到了问题的原因。正如您所提到的,LLM 现在在管理员设置中有一个单独的区域。

定义 OpenAI LLM 后,我现在可以选择不同 AI 功能的模型。

1 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.