n4ze3m / dialoqbase

Create chatbots with ease
https://dialoqbase.n4ze3m.com/
MIT License
1.64k stars 266 forks source link

Apply dify api endpoint #309

Open hkjang opened 4 days ago

hkjang commented 4 days ago

I would like to be able to get chat responses by calling the dify api endpoint in dialoqbase. The dify api url is changeable.

curl --location --request POST 'https://api.dify.ai/v1/completion-messages' \
--header 'Authorization: Bearer ENTER-YOUR-SECRET-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "inputs": {},
    "response_mode": "streaming",
    "user": "abc-123"
}'

or

curl --location --request POST 'https://api.dify.ai/v1/chat-messages' \
--header 'Authorization: Bearer ENTER-YOUR-SECRET-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "inputs": {},
    "query": "eh",
    "response_mode": "streaming",
    "conversation_id": "1c7e55fb-1ba2-4e10-81b5-30addcea2276",
    "user": "abc-123"
}'
n4ze3m commented 3 days ago

Does Dify have an OpenAI-compatible endpoint? I haven't used it yet, but I'll check if it's possible