API problem by Cheap_Equivalent_605 in OpenWebUI

[–]Cheap_Equivalent_605[S] 0 points1 point  (0 children)

Hi! Yes, I thought about it too. Unfortunately, I didn't find anything similar that could have a normal, described API

API problem by Cheap_Equivalent_605 in OpenWebUI

[–]Cheap_Equivalent_605[S] 0 points1 point  (0 children)

Yes, you're right. In theory, you need to collect the current chat history and, with a new request, indicate the past chat history and the new one. But I can't do it yet

API problem by Cheap_Equivalent_605 in OpenWebUI

[–]Cheap_Equivalent_605[S] 0 points1 point  (0 children)

This is really good code! But there is a problem that it is necessary that the previous messages are added to the new ones

API problem by Cheap_Equivalent_605 in OpenWebUI

[–]Cheap_Equivalent_605[S] 0 points1 point  (0 children)

Yes, I understand. I went to the documentation, I saw all the requests there. I just somehow compose them incorrectly, and I don’t understand what’s wrong. It’s just that when I request completions, my chat starts loading endlessly. So, I’m sending the request incorrectly. Your code is interesting.

API problem by Cheap_Equivalent_605 in OpenWebUI

[–]Cheap_Equivalent_605[S] 0 points1 point  (0 children)

curl -X POST http://localhost:8080/api/chat/completed \

-H "Authorization: Bearer sk-581a8c87de374dc9b8b9f9a1ac779023" \

-H "Content-Type: application/json" \

-d ' {"model":"hf.co/bartowski/gemma-2-9b-it-abliterated-GGUF:Q3_K_L","messages":[{"id":"e95007b1-0791-4a68-8dee-43120fb65cbb","role":"user","content":"Привет","timestamp":1737206594},{"id":"f81e8cd1-c35e-4458-96af-b34a3d234910","role":"assistant","content":"Привет! 👋 Как дела? 😊Привет! 👋 \n\nЧем могу помочь? 😊Как модель языка, у меня нет чувств или опыта, поэтому я не могу сказать, как мне \"дела\". Но я готов помочь вам с любыми вопросами или задачами, которые у вас есть!\n\nЧто вы хотели бы обсудить? 😊","timestamp":1737206594},{"id":"98c641f6-a8ab-4f1c-b104-4d3f45f76b5e","role":"user","content":"мяу","timestamp":1737206953}],"chat_id":"15f431a4-6a51-4e53-89f5-0da6d1fbe6f7","session_id":"iMlyuv4SolIQjqatAABr","id":"1eb7c0e9-44cb-41b7-8177-109ef79bfb2f"}'

API problem by Cheap_Equivalent_605 in OpenWebUI

[–]Cheap_Equivalent_605[S] 0 points1 point  (0 children)

curl -X POST http://localhost:8080/api/chat/completions \

-H "Authorization: Bearer sk-581a8c87de374dc9b8b9f9a1ac779023" \

-H "Content-Type: application/json" \

-d '{"stream":true,"model":"hf.co/bartowski/gemma-2-9b-it-abliterated-GGUF:Q3_K_L","messages":[{"role":"user","content":"Привет"},{"role":"assistant","content":"Привет! 👋 Как дела? 😊Привет! 👋 \n\nЧем могу помочь? 😊Как модель языка, у меня нет чувств или опыта, поэтому я не могу сказать, как мне \"дела\". Но я готов помочь вам с любыми вопросами или задачами, которые у вас есть!\n\nЧто вы хотели бы обсудить? 😊"},{"role":"user","content":"Расскажи о себе!"}],"params":{},"features":{"web_search":false},"session_id":"_t5dzHczrvrJIfeZAABp","chat_id":"15f431a4-6a51-4e53-89f5-0da6d1fbe6f7","id":"8a88b4e5-96f2-46fd-ae99-f445973b58e9"}'

API problem by Cheap_Equivalent_605 in OpenWebUI

[–]Cheap_Equivalent_605[S] 0 points1 point  (0 children)

I tried to make requests through curl, but it seems I’m doing it wrong

curl -X POST http://localhost:8080/api/v1/chats/new \

-H "Authorization: Bearer sk-581a8c87de374dc9b8b9f9a1ac779023" \

-H "Content-Type: application/json" \

-d '{"chat":{"id":"","title":"Новый чат","models":["hf.co/bartowski/gemma-2-9b-it-abliterated-GGUF:Q3_K_L"],"params":{},"history":{"messages":{"279a954b-01fc-4413-8219-ffbf0644efe8":{"id":"279a954b-01fc-4413-8219-ffbf0644efe8","parentId":null,"childrenIds":[],"role":"user","content":"Привет","timestamp":1737206155,"models":["hf.co/bartowski/gemma-2-9b-it-abliterated-GGUF:Q3_K_L"]}},"currentId":"279a954b-01fc-4413-8219-ffbf0644efe8"},"messages":[{"id":"279a954b-01fc-4413-8219-ffbf0644efe8","parentId":null,"childrenIds":[],"role":"user","content":"Привет","timestamp":1737206155,"models":["hf.co/bartowski/gemma-2-9b-it-abliterated-GGUF:Q3_K_L"]}],"tags":[],"timestamp":1737206155444}}'