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
70c5d1aa
Commit
70c5d1aa
authored
Jul 24, 2023
by
John Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: OpenAIFunctionCallSummarizeMixin error
parent
dcd46198
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
+2
-6
openai_function_call_summarize_mixin.py
api/core/agent/agent/openai_function_call_summarize_mixin.py
+2
-1
app_model_config_service.py
api/services/app_model_config_service.py
+0
-5
No files found.
api/core/agent/agent/openai_function_call_summarize_mixin.py
View file @
70c5d1aa
...
...
@@ -4,11 +4,12 @@ from langchain.chat_models import ChatOpenAI
from
langchain.chat_models.openai
import
_convert_message_to_dict
from
langchain.memory.summary
import
SummarizerMixin
from
langchain.schema
import
SystemMessage
,
HumanMessage
,
BaseMessage
,
AIMessage
,
BaseLanguageModel
from
pydantic
import
BaseModel
from
core.agent.agent.calc_token_mixin
import
ExceededLLMTokensLimitError
,
CalcTokenMixin
class
OpenAIFunctionCallSummarizeMixin
(
CalcTokenMixin
):
class
OpenAIFunctionCallSummarizeMixin
(
BaseModel
,
CalcTokenMixin
):
moving_summary_buffer
:
str
=
""
moving_summary_index
:
int
=
0
summary_llm
:
BaseLanguageModel
...
...
api/services/app_model_config_service.py
View file @
70c5d1aa
...
...
@@ -161,11 +161,6 @@ class AppModelConfigService:
if
not
isinstance
(
config
[
"speech_to_text"
][
"enabled"
],
bool
):
raise
ValueError
(
"enabled in speech_to_text must be of boolean type"
)
provider_name
=
LLMBuilder
.
get_default_provider
(
account
.
current_tenant_id
,
'whisper-1'
)
if
config
[
"speech_to_text"
][
"enabled"
]
and
provider_name
!=
'openai'
:
raise
ValueError
(
"provider not support speech to text"
)
# more_like_this
if
'more_like_this'
not
in
config
or
not
config
[
"more_like_this"
]:
config
[
"more_like_this"
]
=
{
...
...
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