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.3k stars 6.36k forks source link

There is no price info for zhipuai models #7083

Closed orangeclk closed 1 month ago

orangeclk commented 1 month ago

Self Checks

Dify version

0.6.16

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Check the monitoring panel and you will find there is no price info. image

✔️ Expected Behavior

It should be possible to calculate the price correctly.

❌ Actual Behavior

No response

dosubot[bot] commented 1 month ago

To enable price calculation for ZhipuAI models in your self-hosted Docker setup, ensure that the ZHIPUAI_API_KEY environment variable is set. This key is necessary for fetching the price information.

Here is the relevant code snippet that checks for the api_key:

if api_key is None:
    api_key = os.environ.get("ZHIPUAI_API_KEY")
if api_key is None:
    raise ZhipuAIError("未提供api_key,请通过参数或环境变量提供")

Make sure to set the ZHIPUAI_API_KEY in your environment variables to resolve the issue with missing price information for ZhipuAI models [1].

To continue talking to Dosu, mention @dosu.