unit-mesh / auto-dev

🧙‍AutoDev: The AI-powered coding wizard(AI 驱动编程助手) with multilingual support 🌐, auto code generation 🏗️, and a helpful bug-slaying assistant 🐞! Customizable prompts 🎨 and a magic Auto Dev/Testing/Document/Agent feature 🧪 included! 🚀
https://ide.unitmesh.cc/
Mozilla Public License 2.0
2.74k stars 315 forks source link

Support POE API #231

Closed boostarcher closed 5 days ago

boostarcher commented 3 weeks ago

POE supports many bots including claude 3.5 without charge. I saw that some guys developed bots with the POE API: https://github.com/Timmy-web/Poe-Telegram-Chatbot?tab=readme-ov-file

https://github.com/poe-platform/fastapi_poe

Thus I was wondering if support for it can be added in this plugin, or if there is already support for it, how to set that up?

boostarcher commented 3 weeks ago

Here is the sample call in postman to poe api

Post https://api.poe.com/bot/Claude-3.5-Sonnet

Request Header: host:api.poe.com accept-encoding:gzip, deflate connection:keep-alive user-agent:python-httpx/0.27.0 accept:text/event-stream cache-control:no-store content-type:application/json Authorization:Bearer <API Key, generated from https://poe.com/api_key>

Request body: { "version": "1.0", "type": "query", "query": [{ "role": "user", "sender_id": null, "content": "Hello world", "content_type": "text/markdown", "timestamp": 0, "message_id": "", "feedback": [], "attachments": [] } ], "user_id": "", "conversation_id": "", "message_id": "", "metadata": "", "api_key": "", "access_key": "", "temperature": 0.7, "skip_system_prompt": false, "logit_bias": {}, "stop_sequences": [], "language_code": "en", "bot_query_id": "" }

Response: {"text": " can I assist you today"}

phodal commented 3 weeks ago

I don't have Poe API, but I think custom req/res will support this. For more, see in : https://ide.unitmesh.cc/custom/llm-server