mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
Using Agent with LiteLLM Bedrock Deepseek: The stop sequence you provided at index 0 is longer than the model limit of 10 characters #299
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @micology-code on GitHub (May 20, 2025).
Self Checks
Dify version
1.4.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Create a Agent, select AWS Bedrock serverless deepseek model provided via LiteLLM, using OpenAI compatible API in dify.
Say Hi,
LiteLLM receive request:
The deep seek model works properly in normal Chat/Chat flow LLM, but agent seems to use the stop sequence of
Observationwhich breaks it✔️ Expected Behavior
Works
❌ Actual Behavior
@dosubot[bot] commented on GitHub (May 20, 2025):
Hi @micology-code! I'm Dosu, a bot here to help you with bugs, answer your questions, and assist you in becoming a contributor. I'm here while you wait for a human maintainer. Let's tackle your issue together!
The error you're encountering is due to the stop sequence "Observation" being longer than the model's character limit of 10 characters. To resolve this issue, you need to use a stop sequence that is 10 characters or fewer.
In the Dify codebase, the stop sequence is configured in the
completion_paramsdictionary, which is part of the agent's setup. You can modify this configuration to use a shorter stop sequence. Here's a general approach to address this:Locate the configuration for the stop sequence in your setup. This is typically found in the
api/core/workflow/nodes/llm/node.pyfile, where the stop sequences are extracted from thecompletion_paramsdictionary [1].Change the stop sequence from "Observation" to a shorter string that fits within the 10-character limit. For example, you could use "Obs" or any other suitable abbreviation.
Test the agent again with the updated stop sequence to ensure it works without triggering the character limit error.
By making these adjustments, you should be able to use the LiteLLM Bedrock Deepseek model without encountering the stop sequence length issue.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other