Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
a3ee037d
Unverified
Commit
a3ee037d
authored
Jun 05, 2023
by
John Wang
Committed by
GitHub
Jun 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: optimize output parse failed error (#298)
parent
2de18a64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
llm_generator.py
api/core/generator/llm_generator.py
+3
-1
No files found.
api/core/generator/llm_generator.py
View file @
a3ee037d
import
logging
import
logging
from
langchain.chat_models.base
import
BaseChatModel
from
langchain.chat_models.base
import
BaseChatModel
from
langchain.schema
import
HumanMessage
from
langchain.schema
import
HumanMessage
,
OutputParserException
from
core.constant
import
llm_constant
from
core.constant
import
llm_constant
from
core.llm.llm_builder
import
LLMBuilder
from
core.llm.llm_builder
import
LLMBuilder
...
@@ -153,6 +153,8 @@ class LLMGenerator:
...
@@ -153,6 +153,8 @@ class LLMGenerator:
try
:
try
:
output
=
llm
(
query
)
output
=
llm
(
query
)
rule_config
=
output_parser
.
parse
(
output
)
rule_config
=
output_parser
.
parse
(
output
)
except
OutputParserException
:
raise
ValueError
(
'Please give a valid input for intended audience or hoping to solve problems.'
)
except
Exception
:
except
Exception
:
logging
.
exception
(
"Error generating prompt"
)
logging
.
exception
(
"Error generating prompt"
)
rule_config
=
{
rule_config
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment