langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
45.31k stars 6.37k forks source link

Please support for an interface similar to OpenAI's multi-turn dialogue #7261

Closed bswaterb closed 1 month ago

bswaterb commented 1 month ago

Self Checks

1. Is this request related to a challenge you're experiencing? Tell me about your story.

When calling OpenAI's Chat-Message API, you can pass session information using the "messages" parameter, allowing me to manually construct a historical context to include, such as:

curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
     "model": "gpt-4o-mini",
     "messages": [{"role": "user", "content": "Here is the content"}, {"role": "assistant", "content": "OK"}, {"role": "user", "content": "what are we talking about?"}],
     "temperature": 0.7
   }'

However, in the external API interface or Workflow provided by Dify, it is not possible to complete tasks based on context provided externally; you can only initiate a conversation and maintain the context of that conversation through Dify itself.

Therefore, I request that Dify support an interface that allows users to construct their own historical context for conversation generation.

2. Additional context or comments

No response

3. Can you help us with this feature?

crazywoola commented 1 month ago

You should use Chatflow or Agent. Workflow is designed as a one-off task.