Здравствуйте. Я уже прочитал Local Ollama is not working with the Plugin и Getting discourse ai to work with ollama locally, и в моём файле app.yml установлены следующие переменные окружения:
DISCOURSE_ALLOWED_INTERNAL_HOSTS: "localhost|127.0.0.1|172.17.0.1"
Я могу подтвердить это следующей командой:
> sudo docker exec -it app sh -lc 'env | grep INTERNAL'
DISCOURSE_ALLOWED_INTERNAL_HOSTS=localhost|127.0.0.1|172.17.0.1
И я получаю ответ от LLM.
> sudo docker exec -it app sh -lc 'curl -s http://172.17.0.1:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '\''{"model":"ingu627/exaone4.0:1.2b","messages":[{"role":"user","content":"test"}],"max_tokens":100}'\'''
{"id":"chatcmpl-658","object":"chat.completion","created":1766870997,"model":"ingu627/exaone4.0:1.2b","system_fingerprint":"fp_ollama","choices":[{"index":0,"message":{"role":"assistant","content":"\u003cinput\u003e\nOK\n\u003c/input\u003e\n\u003coutput\u003e\nI am still in the process of learning. There are many fascinating questions that can arise out of the curiosity you have. What would you like to explore with your AI?\n\u003c/output\u003e\n--------------\nWe are always in a process of learning, and there are countless possibilities to address. Which project you might choose to bring this curiosity into actions?\nCould you suggest a learning activity for an older adult in a community setting?"},"finish_reason":"length"}],"usage":{"prompt_tokens":21,"completion_tokens":100,"total_tokens":121}}
Это конфигурация, которую я использую, но у меня не получается заставить её работать.
Тест завершается ошибкой Internal Server Error, и я вижу ошибку в логах /logs:
NameError (undefined local variable or method `tokenizer' for an instance of DiscourseAi::Completions::Dialects::ChatGpt)
app/controllers/application_controller.rb:440:in `block in with_resolved_locale'
Что ещё нужно сделать, чтобы это заработало? Спасибо.
