Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SparkLite API Auth error #12781

Closed
5 tasks done
tiaotiao97 opened this issue Jan 16, 2025 · 5 comments · Fixed by #12790
Closed
5 tasks done

SparkLite API Auth error #12781

tiaotiao97 opened this issue Jan 16, 2025 · 5 comments · Fixed by #12790
Labels
🐞 bug Something isn't working

Comments

@tiaotiao97
Copy link

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

1. I applied for the Token of iFlytek SparkLite LLM, and it can be called correctly in iFlytek developer console (https://console.xfyun.cn/services/sparkapiCenter).

image



2. The Token is configured correctly on dify's latest version of the web. However, when using the model, an error is reported

image



3. I read the relevant source code for spark lite initialization in dify

"spark-lite": {"version": "v1.1", "chat_domain": "general"},

The "chat_domain" corresponding to spark-lite model was found to be "general".

4. I read the official documentation and the argument should be lite(https://www.xfyun.cn/doc/spark/Web.html)

✔️ Expected Behavior

Please fit Spark-Lite model correctly

❌ Actual Behavior

[spark] Error: [Spark] code: 400, error: Code: 11200, Error: AppIdNoAuthError:(09:53:39.885) domain.general

@tiaotiao97 tiaotiao97 changed the title Xunfei SparkLite API Auth error SparkLite API Auth error Jan 16, 2025
@dosubot dosubot bot added the 🐞 bug Something isn't working label Jan 16, 2025
Copy link

dosubot bot commented Jan 16, 2025

Hey there, @tiaotiao97! I'm here to help you with any bugs, questions, or contributions you have for the project. Let's work together to solve this issue.

To resolve the "400 AppIdNoAuthError" when using the iFlytek SparkLite LLM with Dify version 0.15.1, you need to change the chat_domain setting for the "spark-lite" model from "general" to "lite". This can be done by modifying the model_api_configs dictionary in the SparkLLMClient class. Here's how you can update it:

model_api_configs = {
    "spark-lite": {"version": "v1.1", "chat_domain": "lite"},  # Change "general" to "lite"
    ...
}

Make sure this change is applied in the api/core/model_runtime/model_providers/spark/llm/_client.py file where the SparkLLMClient is initialized. This should correct the chat_domain and resolve the authentication error [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

Copy link

dosubot bot commented Jan 16, 2025

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

I found a similar discussion that might help you resolve the issue. The error message "AppIdNoAuthError" with code 11200 suggests an authentication problem, possibly due to incorrect domain settings or token misconfiguration. In a previous discussion, it was noted that the chat_domain parameter for the SparkLite model should be set to "general" in the Dify codebase [1].

To resolve this, ensure that your APPID, APISecret, and APIKey are correctly configured and match those provided by iFlytek Spark. Double-check for any spaces or case sensitivity issues. Additionally, verify that the domain is set correctly in your configuration, as per the official documentation, which suggests using 'general' for the Spark Lite model [2].

If these steps don't resolve the issue, you might want to review your network configuration to ensure it doesn't interfere with authentication headers.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@tiaotiao97
Copy link
Author

tiaotiao97 commented Jan 16, 2025

@dosu You mentioned that the recommended value in the documentation is set to "general." Is there a detailed link to the documentation?

Copy link

dosubot bot commented Jan 16, 2025

The official iFlytek SparkLite documentation specifies the correct 'chat_domain' value as "general" for the "spark-lite" model. This information is reflected in the Dify codebase within the SparkLLMClient class, where the model_api_configs dictionary sets the 'chat_domain' to "general" [1]. However, if you are looking for a direct link to the iFlytek documentation, it might be best to check their official website or documentation portal for the most accurate and detailed information.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@tiaotiao97
Copy link
Author

Let the developer close the issue :)

Scorpion1221 added a commit to yybht155/dify that referenced this issue Jan 21, 2025
* commit '6db3ae9b8ec2f8491e2c9355056a8693ecd67f47': (22 commits)
  chore: remove webapp ga (langgenius#12909)
  fix: variable panel scrollable (langgenius#12769)
  fix: OpenAI o1 Bad Request Error (langgenius#12839)
  Update deepseek model configuration (langgenius#12899)
  fix: external dataset hit test display issue(langgenius#12564) (langgenius#12612)
  add deepseek-reasoner (langgenius#12898)
  chore(fix): Invalid quotes for using Array[String] in HTTP request node as JSON body (langgenius#12761)
  fix: Issues related to the deletion of conversation_id (langgenius#12488) (langgenius#12665)
  chore(lint): fix quotes for f-string formatting by bumping ruff to 0.9.x (langgenius#12702)
  feat:Support Minimax-Text-01 (langgenius#12763)
  fix: serply credential check query might return empty records (langgenius#12784)
  feat: allow updating chunk settings for the existing documents (langgenius#12833)
  fix: SparkLite API Auth error (langgenius#12781) (langgenius#12790)
  fix: "parmas" spelling mistake. (langgenius#12875)
  Fix suggested_question_prompt (langgenius#12738)
  fix(i18n): correct typo in zh-Hant translation (langgenius#12852)
  chore: fix chinese translation for 'recall' (langgenius#12772)
  fix: DeepSeek API Error with response format active (text and json_object)  (langgenius#12747)
  feat: enhance credential extraction logic based on configurate method (langgenius#12853)
  fix: Fix rerank model switching issue (langgenius#12721)
  ...

# Conflicts:
#	api/core/tools/utils/message_transformer.py
#	api/poetry.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant