# خطأ عند تحديث وحفظ مزود API لوحدة التضمينات

**URL:** https://meta.discourse.org/t/error-when-updating-and-saving-the-api-provider-for-embeddings-module/305763
**Category:** Support
**Tags:** ai
**Created:** [28 أبريل 2024، 8:34ص UTC](https://meta.discourse.org/t/error-when-updating-and-saving-the-api-provider-for-embeddings-module/305763 "2024-04-28T08:34:45Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![fracool](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fracool/32/311603_2.png) [@fracool](https://meta.discourse.org/u/fracool)
#### Post date: [28 أبريل 2024، 8:34ص UTC](https://meta.discourse.org/t/error-when-updating-and-saving-the-api-provider-for-embeddings-module/305763/1 "2024-04-28T08:34:45Z")

</div>

حدث خطأ أثناء تحديث وحفظ موفر واجهة برمجة التطبيقات (API) لوحدة التضمين. “حدث خطأ”. تعذر تغيير موفر واجهة برمجة التطبيقات (API) لوحدة التضمين.

أقدر إذا كان بإمكان أي شخص إخباري ما إذا كان هذا يحدث لي فقط؟ هذا تثبيت جديد جدًا ولدي فقط المكون الإضافي للذكاء الاصطناعي مثبتًا، ولا توجد مكونات إضافية أخرى.

```plaintext
Message (12 copies reported)

NoMethodError (undefined method `[]' for nil:NilClass)
lib/site_settings/type_supervisor.rb:284:in `validate_value'
lib/site_settings/type_supervisor.rb:165:in `to_db_value'
lib/site_setting_extension.rb:368:in `add_override!'
lib/site_setting_extension.rb:604:in `block in setup_methods'
lib/site_setting_extension.rb:435:in `public_send'
lib/site_setting_extension.rb:435:in `set'
lib/site_setting_extension.rb:448:in `set_and_log'
app/controllers/admin/site_settings_controller.rb:56:in `update'
app/controllers/application_controller.rb:423:in `block in with_resolved_locale'
app/controllers/application_controller.rb:423:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:64:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:393:in `call'
lib/middleware/csp_script_nonce_injector.rb:12:in `call'
config/initializers/008-rack-cors.rb:14:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:274:in `call'

Backtrace

plugins/discourse-ai/lib/embeddings/vector_representations/text_embedding_ada_002.rb:47:in `vector_from'
plugins/discourse-ai/lib/configuration/embeddings_model_validator.rb:41:in `can_generate_embeddings?'
plugins/discourse-ai/lib/configuration/embeddings_model_validator.rb:23:in `valid_value?'
lib/site_settings/type_supervisor.rb:284:in `validate_value'
lib/site_settings/type_supervisor.rb:165:in `to_db_value'
lib/site_setting_extension.rb:368:in `add_override!'
lib/site_setting_extension.rb:604:in `block in setup_methods'
lib/site_setting_extension.rb:435:in `public_send'
lib/site_setting_extension.rb:435:in `set'
lib/site_setting_extension.rb:448:in `set_and_log'
app/controllers/admin/site_settings_controller.rb:56:in `update'
actionpack (7.0.8.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (7.0.8.1) lib/abstract_controller/base.rb:215:in `process_action'
actionpack (7.0.8.1) lib/action_controller/metal/rendering.rb:165:in `process_action'
actionpack (7.0.8.1) lib/abstract_controller/callbacks.rb:234:in `block in process_action'
activesupport (7.0.8.1) lib/active_support/callbacks.rb:118:in `block in run_callbacks'
app/controllers/application_controller.rb:423:in `block in with_resolved_locale'
app/controllers/application_controller.rb:423:in `with_resolved_locale'
activesupport (7.0.8.1) lib/active_support/callbacks.rb:127:in `block in run_callbacks'
activesupport (7.0.8.1) lib/active_support/callbacks.rb:138:in `run_callbacks'
actionpack (7.0.8.1) lib/abstract_controller/callbacks.rb:233:in `process_action'
actionpack (7.0.8.1) lib/action_controller/metal/rescue.rb:23:in `process_action'
actionpack (7.0.8.1) lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'
activesupport (7.0.8.1) lib/active_support/notifications.rb:206:in `block in instrument'
activesupport (7.0.8.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (7.0.8.1) lib/active_support/notifications.rb:206:in `instrument'
actionpack (7.0.8.1) lib/action_controller/metal/instrumentation.rb:66:in `process_action'
actionpack (7.0.8.1) lib/action_controller/metal/params_wrapper.rb:259:in `process_action'
activerecord (7.0.8.1) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (7.0.8.1) lib/abstract_controller/base.rb:151:in `process'
actionview (7.0.8.1) lib/action_view/rendering.rb:39:in `process'
rack-mini-profiler (3.3.1) lib/mini_profiler/profiling_methods.rb:115:in `block in profile_method'
actionpack (7.0.8.1) lib/action_controller/metal.rb:188:in `dispatch'
actionpack (7.0.8.1) lib/action_controller/metal.rb:251:in `dispatch'
actionpack (7.0.8.1) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (7.0.8.1) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (7.0.8.1) lib/action_dispatch/routing/mapper.rb:18:in `block in <class:Constraints>'
actionpack (7.0.8.1) lib/action_dispatch/routing/mapper.rb:48:in `serve'
actionpack (7.0.8.1) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (7.0.8.1) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (7.0.8.1) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (7.0.8.1) lib/action_dispatch/routing/route_set.rb:852:in `call'
lib/middleware/omniauth_bypass_middleware.rb:64:in `call'
rack (2.2.9) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.9) lib/rack/conditional_get.rb:40:in `call'
rack (2.2.9) lib/rack/head.rb:12:in `call'
actionpack (7.0.8.1) lib/action_dispatch/http/permissions_policy.rb:38:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:393:in `call'
lib/middleware/csp_script_nonce_injector.rb:12:in `call'
config/initializers/008-rack-cors.rb:14:in `call'
rack (2.2.9) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.9) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (7.0.8.1) lib/action_dispatch/middleware/cookies.rb:704:in `call'
actionpack (7.0.8.1) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (7.0.8.1) lib/active_support/callbacks.rb:99:in `run_callbacks'
actionpack (7.0.8.1) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (7.0.8.1) lib/action_dispatch/middleware/debug_exceptions.rb:28:in `call'
actionpack (7.0.8.1) lib/action_dispatch/middleware/show_exceptions.rb:29:in `call'
logster (2.19.1) lib/logster/middleware/reporter.rb:40:in `call'
railties (7.0.8.1) lib/rails/rack/logger.rb:40:in `call_app'
railties (7.0.8.1) lib/rails/rack/logger.rb:27:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
actionpack (7.0.8.1) lib/action_dispatch/middleware/remote_ip.rb:93:in `call'
actionpack (7.0.8.1) lib/action_dispatch/middleware/request_id.rb:26:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
rack (2.2.9) lib/rack/method_override.rb:24:in `call'
actionpack (7.0.8.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
rack (2.2.9) lib/rack/sendfile.rb:110:in `call'
actionpack (7.0.8.1) lib/action_dispatch/middleware/host_authorization.rb:131:in `call'
rack-mini-profiler (3.3.1) lib/mini_profiler.rb:334:in `call'
message_bus (4.3.8) lib/message_bus/rack/middleware.rb:60:in `call'
lib/middleware/request_tracker.rb:274:in `call'
railties (7.0.8.1) lib/rails/engine.rb:530:in `call'
railties (7.0.8.1) lib/rails/railtie.rb:226:in `public_send'
railties (7.0.8.1) lib/rails/railtie.rb:226:in `method_missing'
rack (2.2.9) lib/rack/urlmap.rb:74:in `block in call'
rack (2.2.9) lib/rack/urlmap.rb:58:in `each'
rack (2.2.9) lib/rack/urlmap.rb:58:in `call'
unicorn (6.1.0) lib/unicorn/http_server.rb:634:in `process_client'
unicorn (6.1.0) lib/unicorn/http_server.rb:739:in `worker_loop'
unicorn (6.1.0) lib/unicorn/http_server.rb:547:in `spawn_missing_workers'
unicorn (6.1.0) lib/unicorn/http_server.rb:143:in `start'
unicorn (6.1.0) bin/unicorn:128:in `<top (required)>'
vendor/bundle/ruby/3.2.0/bin/unicorn:25:in `load'
vendor/bundle/ruby/3.2.0/bin/unicorn:25:in `<main>'

Env

HTTP HOSTS: talk.allotmentforum.com

```

 ![Screenshot 2024-04-28 at 09.36.15](https://global.discourse-cdn.com/meta/original/4X/7/2/6/72645cde6ef9fba3623db262c06c69e03a53a500.png)

شكرا، ف

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [28 أبريل 2024، 9:23ص UTC](https://meta.discourse.org/t/error-when-updating-and-saving-the-api-provider-for-embeddings-module/305763/2 "2024-04-28T09:23:08Z")

</div>

هل لا يزال ada-002 قيد الاستخدام 🤔

---

<div class="post-metadata">

### Author: ![fracool](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fracool/32/311603_2.png) [@fracool](https://meta.discourse.org/u/fracool)
#### Post date: [28 أبريل 2024، 9:53ص UTC](https://meta.discourse.org/t/error-when-updating-and-saving-the-api-provider-for-embeddings-module/305763/3 "2024-04-28T09:53:21Z")

</div>

لا! للأسف لا، إنها عالقة على الإعداد الافتراضي الذي يأتي معه المكون الإضافي للذكاء الاصطناعي، أحاول تحديثه لاستخدام ada-002.

 ![Screenshot 2024-04-28 at 10.52.20](https://global.discourse-cdn.com/meta/original/4X/0/9/5/0956928c65b3e146b2a6b3113b575d209ca36646.png)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [28 أبريل 2024، 3:14م UTC](https://meta.discourse.org/t/error-when-updating-and-saving-the-api-provider-for-embeddings-module/305763/4 "2024-04-28T15:14:25Z")

</div>

ما هي إعدادات واجهة برمجة تطبيقات OpenAI الخاصة بك؟

---

<div class="post-metadata">

### Author: ![fracool](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fracool/32/311603_2.png) [@fracool](https://meta.discourse.org/u/fracool)
#### Post date: [28 أبريل 2024، 3:37م UTC](https://meta.discourse.org/t/error-when-updating-and-saving-the-api-provider-for-embeddings-module/305763/5 "2024-04-28T15:37:25Z")

</div>

لدي:

 ![Screenshot 2024-04-28 at 16.32.43](https://global.discourse-cdn.com/meta/original/4X/7/4/d/74df3db4029cb82dce09dc4c4d023f0d557bcfed.png)  
المفتاح شرعي وقد تحققت منه - لقد حاولت إضافة معرف المؤسسة أيضًا ولكن نفس النتيجة مع عدم القدرة على حفظ الإعداد:  
 ![Screenshot 2024-04-28 at 16.35.43](https://global.discourse-cdn.com/meta/original/4X/1/6/4/16493f05c5bbf586e57b418b7d985b71e0f0615a.png)  
يبدو أن مفاتيح openai فقط هي التي تفشل في الحفظ… نفس الشيء من وحدة التحكم مثل الحفظ عبر الموقع:  
 ![Screenshot 2024-04-28 at 16.36.05](https://global.discourse-cdn.com/meta/original/4X/7/c/c/7cc0d30e561749531d7269bfef235871c23632cb.png)

---

<div class="post-metadata">

### Author: ![fracool](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fracool/32/311603_2.png) [@fracool](https://meta.discourse.org/u/fracool)
#### Post date: [28 أبريل 2024، 4:03م UTC](https://meta.discourse.org/t/error-when-updating-and-saving-the-api-provider-for-embeddings-module/305763/6 "2024-04-28T16:03:28Z")

</div>

اتضح أن الخطأ كان مني، لقد تركت رصيدي في OpenAI ينفد ولم ألاحظ ذلك! كما كنت أستخدم مفتاح واجهة برمجة تطبيقات بأسلوب أقدم بدلاً من أحد المفاتيح بصيغة sk-proj.

إنه يعمل الآن بعد أن قمت بتعبئة حسابي في OpenAI.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [28 مايو 2024، 4:03م UTC](https://meta.discourse.org/t/error-when-updating-and-saving-the-api-provider-for-embeddings-module/305763/7 "2024-05-28T16:03:28Z")

</div>

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