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
51.81k stars 7.51k forks source link

Sending app information to model_providers methods #8764

Closed umut-ramazan closed 6 days ago

umut-ramazan commented 1 month ago

Self Checks

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

There is an ai gateway project that we use. We want to include dify in it. But when sending a request to providers, I need to specify which app it is in the header. We want this feature to come.

2. Additional context or comments

We tried several times but couldn't find the place that calls the providers. Incoming requests are coming to api/controllers/console/app/workflow.py but we couldn't find how they land on the provider through debugging. api/core/provider_manager.py:51 also generates the provider credentials. But we couldn't find how to provide the app id or app name there. How can we do this?

3. Can you help us with this feature?