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

0.6.15 + Iterator invoke tool: Failed to invoke tool: model_name in input form must be one of the following: ['claude-3.5-sonnet', 'gpt-4o', 'gemini-1.5-pro'] #6643

Closed onlyfish79 closed 1 month ago

onlyfish79 commented 1 month ago

Self Checks

Dify version

0.6.15

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Workflow

  2. version 0.6.14 no problem; 0.6.15 report error.

  3. Iterator input: models list: ['claude-3.5-sonnet', 'gpt-4o', 'gemini-1.5-pro']

  4. Iterator invoke tool, tool requres input model list: ['claude-3.5-sonnet', 'gpt-4o', 'gemini-1.5-pro'] img_v3_02d3_9a48c4c6-99eb-4911-93e7-7098ea2b813g

  5. 0.6.14 vs 0.6.15 excute result

img_v3_02d3_9d11a9ca-ffb2-49d2-88d0-c53d090a891g

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

dosubot[bot] commented 1 month ago

Hey @onlyfish79! 👋 I'm here to assist you with bugs, questions, and becoming a contributor. Let's squash those bugs together!

The error you're encountering in version 0.6.15 is likely due to changes in how the model_name parameter is handled or validated. To resolve this issue in your self-hosted Docker environment, follow these steps:

  1. Check the model_name Configuration: Ensure that the model_name is correctly set in the Dify settings under Settings > Model Providers > Ollama. For example, if you are using the llava model, the configuration should look like this:

    - Model Name: `llava`
    - Base URL: `http://<your-ollama-endpoint-domain>:11434`
    - Model Type: `Chat`
    - Model Context Length: `4096`
    - Maximum Token Limit: `4096`
    - Support for Vision: `Yes`
  2. Expose Ollama Service to the Network: If you are running Dify and Ollama in Docker, ensure that the Ollama service is accessible from the Dify container. You may need to replace localhost with host.docker.internal or the appropriate network IP address. For example:

    Base URL: `http://host.docker.internal:11434`
  3. Set Environment Variables: Depending on your operating system, set the OLLAMA_HOST environment variable to expose the Ollama service on the network.

    • On macOS:

      launchctl setenv OLLAMA_HOST "0.0.0.0"
    • On Linux: Edit the systemd service:

      [Service]
      Environment="OLLAMA_HOST=0.0.0.0"

      Reload systemd and restart Ollama:

      systemctl daemon-reload
      systemctl restart ollama
    • On Windows: Edit system environment variables and set OLLAMA_HOST to 0.0.0.0.

By ensuring the correct configuration and network accessibility, you should be able to resolve the model_name error in version 0.6.15 of Dify [1].

To continue talking to Dosu, mention @dosu.

onlyfish79 commented 1 month ago
  1. I'm sure the model configuration is correct.

  2. In invoke tool(workflow), any model of the following: ['claude-3.5-sonnet', 'gpt-4o', 'gemini-1.5-pro'], can return the correct result. (both 0.6.15 and 0.6.14)

  3. Between 0.6.14 and 0.6.15, all configurations are the same. No change.

Your reply doesn't solve my problem.

dosubot[bot] commented 1 month ago

To resolve the issue with the model_name parameter in version 0.6.15 of Dify, ensure that the model_name is set to one of the valid formats listed in the _position.yaml file. The correct format should be one of the following:

- claude-3-5-sonnet-20240620
- claude-3-haiku-20240307
- claude-3-opus-20240229
- claude-3-sonnet-20240229
- claude-2.1
- claude-instant-1.2
- claude-2
- claude-instant-1

For example, you can set the model_name parameter to "claude-3-sonnet-20240229" instead of the incorrect format ['1721820680007', 'item'] [1].

Additionally, ensure that your database schema is updated according to the migration script 4e99a8df00ff_add_load_balancing.py, which includes changes to the provider_name column and the creation of new tables and indexes [2]. This might affect how the model_name parameter is handled in version 0.6.15.

To continue talking to Dosu, mention @dosu.

crazywoola commented 1 month ago

Hello please stay tuned on this PR. https://github.com/langgenius/dify/pull/6635 :) Already working on it.