# 嵌入 \`input 必须少于 8192 个 token\` 的警告与 discourse ai

**URL:** <https://meta.discourse.org/t/warning-of-embedding-input-must-have-less-than-8192-tokens-with-discourse-ai/387332>\
**Category:** Support\
**Tags:** ai\
**Created:** [2025年十一月1日 01:53 UTC](https://meta.discourse.org/t/warning-of-embedding-input-must-have-less-than-8192-tokens-with-discourse-ai/387332 "2025-11-01T01:53:41Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![whitewaterdeu](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@whitewaterdeu](https://meta.discourse.org/u/whitewaterdeu)\
**Post date:** [2025年十一月1日 01:53 UTC](https://meta.discourse.org/t/warning-of-embedding-input-must-have-less-than-8192-tokens-with-discourse-ai/387332/1 "2025-11-01T01:53:41Z")

</div>

是否有工具可以分割输入文本？  
或者哪种嵌入 API 支持超过 8192 个 token？

```plaintext
Message (15 copies reported)

OpenAI Embeddings failed with status: 413 body: {"code":20042,"message":"input must have less than 8192 tokens","data":null}

Backtrace

/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-8.0.3/lib/active_support/broadcast_logger.rb:218:in `block in dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-8.0.3/lib/active_support/broadcast_logger.rb:217:in `map'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-8.0.3/lib/active_support/broadcast_logger.rb:217:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-8.0.3/lib/active_support/broadcast_logger.rb:129:in `warn'
/var/www/discourse/plugins/discourse-ai/lib/inference/open_ai_embeddings.rb:34:in `perform!'
/var/www/discourse/plugins/discourse-ai/lib/embeddings/vector.rb:45:in `block (2 levels) in gen_bulk_reprensentations'
/var/www/discourse/lib/scheduler/thread_pool.rb:118:in `block (2 levels) in wrap_block'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-7.0.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-7.0.0/lib/rails_multisite/connection_management.rb:17:in `with_connection'
/var/www/discourse/lib/scheduler/thread_pool.rb:118:in `block in wrap_block'
/var/www/discourse/lib/scheduler/thread_pool.rb:163:in `thread_loop'
/var/www/discourse/lib/scheduler/thread_pool.rb:174:in `block in spawn_thread'

```

---

_[View the full topic](https://meta.discourse.org/t/warning-of-embedding-input-must-have-less-than-8192-tokens-with-discourse-ai/387332)._
