# Discourse AI 无法翻译大量帖子和主题

**URL:** <https://meta.discourse.org/t/discourse-ai-failing-to-translate-large-number-of-posts-and-topics/385414>\
**Category:** Support\
**Tags:** ai, content-localization\
**Created:** [2025年十月13日 07:55 UTC](https://meta.discourse.org/t/discourse-ai-failing-to-translate-large-number-of-posts-and-topics/385414 "2025-10-13T07:55:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![panrafal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/panrafal/32/380633_2.png) [@panrafal](https://meta.discourse.org/u/panrafal)\
**Post date:** [2025年十月13日 09:17 UTC](https://meta.discourse.org/t/discourse-ai-failing-to-translate-large-number-of-posts-and-topics/385414/2 "2025-10-13T09:17:40Z")

</div>

我找到了 `ai_api_audit_logs`，我认为我已经找到了问题所在。

当发送翻译时，有一个 `get_max_tokens` 函数会根据文本长度分配最大 token 数。

问题是，它大部分都被推理消耗掉了。看看这个审计日志，限制设置为 1000，推理在开始生成输出之前就占用了全部 1000 个 token。

推理模型的限制应该高得多。

```plaintext
data: {"id":"chatcmpl-CQ7XU4Ep16RClb7OZQAxOXN9JWgIG","object":"chat.completion.chunk","created":1760341544,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null}}],"usage":null,"obfuscation":"dPNNK7ojEf"}

data: {"id":"chatcmpl-CQ7XU4Ep16RClb7OZQAxOXN9JWgIG","object":"chat.completion.chunk","created":1760341544,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"length"}],"usage":null,"obfuscation":"dM2r"}

data: {"id":"chatcmpl-CQ7XU4Ep16RClb7OZQAxOXN9JWgIG","object":"chat.completion.chunk","created":1760341544,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":1075,"completion_tokens":1000,"total_tokens":2075,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":1000,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"j4"}

data: [DONE]

```

> <https://github.com/discourse/discourse/blob/26e5fc0d3f33b3229e0c635c5eb685782b246b09/plugins/discourse-ai/lib/translation/base_translator.rb#L57>

---

_[View the full topic](https://meta.discourse.org/t/discourse-ai-failing-to-translate-large-number-of-posts-and-topics/385414)._
