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
1724b874
Commit
1724b874
authored
Jun 25, 2023
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: debug remove query content
parent
742bad93
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
41 deletions
+9
-41
index.tsx
web/app/components/app/configuration/debug/index.tsx
+0
-9
index.tsx
...components/app/configuration/prompt-value-panel/index.tsx
+9
-32
No files found.
web/app/components/app/configuration/debug/index.tsx
View file @
1724b874
...
@@ -279,7 +279,6 @@ const Debug: FC<IDebug> = ({
...
@@ -279,7 +279,6 @@ const Debug: FC<IDebug> = ({
setChatList
([])
setChatList
([])
},
[
controlClearChatMessage
])
},
[
controlClearChatMessage
])
const
[
completionQuery
,
setCompletionQuery
]
=
useState
(
''
)
const
[
completionRes
,
setCompletionRes
]
=
useState
(
''
)
const
[
completionRes
,
setCompletionRes
]
=
useState
(
''
)
const
sendTextCompletion
=
async
()
=>
{
const
sendTextCompletion
=
async
()
=>
{
...
@@ -291,11 +290,6 @@ const Debug: FC<IDebug> = ({
...
@@ -291,11 +290,6 @@ const Debug: FC<IDebug> = ({
if
(
!
checkCanSend
())
if
(
!
checkCanSend
())
return
return
if
(
!
completionQuery
)
{
logError
(
t
(
'appDebug.errorMessage.queryRequired'
))
return
false
}
const
postDatasets
=
dataSets
.
map
(({
id
})
=>
({
const
postDatasets
=
dataSets
.
map
(({
id
})
=>
({
dataset
:
{
dataset
:
{
enabled
:
true
,
enabled
:
true
,
...
@@ -322,7 +316,6 @@ const Debug: FC<IDebug> = ({
...
@@ -322,7 +316,6 @@ const Debug: FC<IDebug> = ({
const
data
=
{
const
data
=
{
inputs
,
inputs
,
query
:
completionQuery
,
model_config
:
postModelConfig
,
model_config
:
postModelConfig
,
}
}
...
@@ -360,8 +353,6 @@ const Debug: FC<IDebug> = ({
...
@@ -360,8 +353,6 @@ const Debug: FC<IDebug> = ({
</
div
>
</
div
>
<
PromptValuePanel
<
PromptValuePanel
appType=
{
mode
as
AppType
}
appType=
{
mode
as
AppType
}
value=
{
completionQuery
}
onChange=
{
setCompletionQuery
}
onSend=
{
sendTextCompletion
}
onSend=
{
sendTextCompletion
}
/>
/>
</
div
>
</
div
>
...
...
web/app/components/app/configuration/prompt-value-panel/index.tsx
View file @
1724b874
...
@@ -16,8 +16,6 @@ import Button from '@/app/components/base/button'
...
@@ -16,8 +16,6 @@ import Button from '@/app/components/base/button'
export
type
IPromptValuePanelProps
=
{
export
type
IPromptValuePanelProps
=
{
appType
:
AppType
appType
:
AppType
value
?:
string
onChange
?:
(
value
:
string
)
=>
void
onSend
?:
()
=>
void
onSend
?:
()
=>
void
}
}
...
@@ -31,8 +29,6 @@ const starIcon = (
...
@@ -31,8 +29,6 @@ const starIcon = (
const
PromptValuePanel
:
FC
<
IPromptValuePanelProps
>
=
({
const
PromptValuePanel
:
FC
<
IPromptValuePanelProps
>
=
({
appType
,
appType
,
value
,
onChange
,
onSend
,
onSend
,
})
=>
{
})
=>
{
const
{
t
}
=
useTranslation
()
const
{
t
}
=
useTranslation
()
...
@@ -147,35 +143,16 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({
...
@@ -147,35 +143,16 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({
{
{
appType
===
AppType
.
completion
&&
(
appType
===
AppType
.
completion
&&
(
<
div
className=
'px-4'
>
<
div
>
<
div
className=
"mt-5 border-b border-gray-100"
></
div
>
<
div
className=
"mt-5 border-b border-gray-100"
></
div
>
<
div
className=
"mt-4"
>
<
div
className=
"flex justify-end mt-4 px-4"
>
<
div
>
<
Button
<
div
className=
"text-[13px] text-gray-900 font-medium"
>
{
t
(
'appDebug.inputs.queryTitle'
)
}
</
div
>
type=
"primary"
<
div
className=
"mt-2 mb-4 overflow-hidden border border-gray-200 rounded-lg grow bg-gray-50 "
>
onClick=
{
()
=>
onSend
&&
onSend
()
}
<
div
className=
"px-4 py-2 rounded-t-lg bg-gray-50"
>
className=
"w-[80px] !h-8"
>
<
textarea
<
PlayIcon
className=
"shrink-0 w-4 h-4 mr-1"
aria
-
hidden=
"true"
/>
rows=
{
4
}
<
span
className=
'uppercase text-[13px]'
>
{
t
(
'appDebug.inputs.run'
)
}
</
span
>
className=
"w-full px-0 text-sm text-gray-900 border-0 bg-gray-50 focus:outline-none placeholder:bg-gray-50"
</
Button
>
placeholder=
{
t
(
'appDebug.inputs.queryPlaceholder'
)
as
string
}
value=
{
value
}
onChange=
{
e
=>
onChange
&&
onChange
(
e
.
target
.
value
)
}
></
textarea
>
</
div
>
<
div
className=
"flex items-center justify-between px-3 py-2 bg-gray-50"
>
<
div
className=
"flex pl-0 space-x-1 sm:pl-2"
>
<
span
className=
"bg-gray-100 text-gray-500 text-xs font-medium mr-2 px-2.5 py-0.5 rounded cursor-pointer"
>
{
value
?.
length
}
</
span
>
</
div
>
<
Button
type=
"primary"
onClick=
{
()
=>
onSend
&&
onSend
()
}
className=
"w-[80px] !h-8"
>
<
PlayIcon
className=
"shrink-0 w-4 h-4 mr-1"
aria
-
hidden=
"true"
/>
<
span
className=
'uppercase text-[13px]'
>
{
t
(
'appDebug.inputs.run'
)
}
</
span
>
</
Button
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
)
)
...
...
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