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
cefc5ae1
Commit
cefc5ae1
authored
Jun 26, 2023
by
Joel
Browse files
Options
Browse Files
Download
Plain Diff
feat: merge
parents
7e2d45d9
32ef9c89
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
17 deletions
+22
-17
base.py
api/core/index/vector_index/base.py
+1
-1
weaviate_vector_index.py
api/core/index/vector_index/weaviate_vector_index.py
+10
-6
client.py
sdks/python-client/dify_client/client.py
+2
-2
setup.py
sdks/python-client/setup.py
+1
-1
index.tsx
web/app/components/app/chat/index.tsx
+7
-5
index.tsx
web/app/components/app/configuration/debug/index.tsx
+1
-2
No files found.
api/core/index/vector_index/base.py
View file @
cefc5ae1
...
...
@@ -157,7 +157,7 @@ class BaseVectorIndex(BaseIndex):
documents
.
append
(
document
)
origin_index_struct
=
self
.
dataset
.
index_struct
origin_index_struct
=
self
.
dataset
.
index_struct
[:]
self
.
dataset
.
index_struct
=
None
if
documents
:
...
...
api/core/index/vector_index/weaviate_vector_index.py
View file @
cefc5ae1
from
typing
import
Optional
,
cast
import
requests
import
weaviate
from
langchain.embeddings.base
import
Embeddings
from
langchain.schema
import
Document
,
BaseRetriever
...
...
@@ -34,12 +35,15 @@ class WeaviateVectorIndex(BaseVectorIndex):
weaviate
.
connect
.
connection
.
has_grpc
=
False
client
=
weaviate
.
Client
(
url
=
config
.
endpoint
,
auth_client_secret
=
auth_config
,
timeout_config
=
(
5
,
60
),
startup_period
=
None
)
try
:
client
=
weaviate
.
Client
(
url
=
config
.
endpoint
,
auth_client_secret
=
auth_config
,
timeout_config
=
(
5
,
60
),
startup_period
=
None
)
except
requests
.
exceptions
.
ConnectionError
:
raise
ConnectionError
(
"Vector database connection error"
)
client
.
batch
.
configure
(
# `batch_size` takes an `int` value to enable auto-batching
...
...
sdks/python-client/dify_client/client.py
View file @
cefc5ae1
...
...
@@ -65,8 +65,8 @@ class ChatClient(DifyClient):
return
self
.
_send_request
(
"GET"
,
"/messages"
,
params
=
params
)
def
get_conversations
(
self
,
user
,
fir
st_id
=
None
,
limit
=
None
,
pinned
=
None
):
params
=
{
"user"
:
user
,
"
first_id"
:
fir
st_id
,
"limit"
:
limit
,
"pinned"
:
pinned
}
def
get_conversations
(
self
,
user
,
la
st_id
=
None
,
limit
=
None
,
pinned
=
None
):
params
=
{
"user"
:
user
,
"
last_id"
:
la
st_id
,
"limit"
:
limit
,
"pinned"
:
pinned
}
return
self
.
_send_request
(
"GET"
,
"/conversations"
,
params
=
params
)
def
rename_conversation
(
self
,
conversation_id
,
name
,
user
):
...
...
sdks/python-client/setup.py
View file @
cefc5ae1
...
...
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
setup
(
name
=
"dify-client"
,
version
=
"0.1.
7
"
,
version
=
"0.1.
8
"
,
author
=
"Dify"
,
author_email
=
"hello@dify.ai"
,
description
=
"A package for interacting with the Dify Service-API"
,
...
...
web/app/components/app/chat/index.tsx
View file @
cefc5ae1
...
...
@@ -352,10 +352,12 @@ const Answer: FC<IAnswerProps> = ({ item, feedbackDisabled = false, isHideFeedba
}
</
div
>
<
div
className=
'absolute top-[-14px] right-[-14px] flex flex-row justify-end gap-1'
>
<
CopyBtn
value=
{
content
}
className=
{
cn
(
s
.
copyBtn
,
'mr-1'
)
}
/>
{
!
item
.
isOpeningStatement
&&
(
<
CopyBtn
value=
{
content
}
className=
{
cn
(
s
.
copyBtn
,
'mr-1'
)
}
/>
)
}
{
!
feedbackDisabled
&&
!
item
.
feedbackDisabled
&&
renderItemOperation
(
displayScene
!==
'console'
)
}
{
/* Admin feedback is displayed only in the background. */
}
{
!
feedbackDisabled
&&
renderFeedbackRating
(
localAdminFeedback
?.
rating
,
false
,
false
)
}
...
...
@@ -487,7 +489,7 @@ const Chat: FC<IChatProps> = ({
},
[
suggestionList
])
return
(
<
div
className=
{
cn
(
!
feedbackDisabled
&&
'px-3.5'
,
'h-full'
)
}
>
<
div
className=
{
cn
(
'px-3.5'
,
'h-full'
)
}
>
{
/* Chat List */
}
<
div
className=
"h-full space-y-[30px]"
>
{
chatList
.
map
((
item
)
=>
{
...
...
web/app/components/app/configuration/debug/index.tsx
View file @
cefc5ae1
...
...
@@ -370,8 +370,7 @@ const Debug: FC<IDebug> = ({
{
mode
===
AppType
.
chat
&&
(
<
div
className=
"mt-[34px] h-full flex flex-col"
>
<
div
className=
{
cn
(
doShowSuggestion
?
'pb-[140px]'
:
(
isResponsing
?
'pb-[113px]'
:
'pb-[66px]'
),
'relative mt-1.5 grow h-[200px] overflow-hidden'
)
}
>
<
div
className=
"h-full overflow-y-auto"
ref=
{
chatListDomRef
}
>
{
/* {JSON.stringify(chatList)} */
}
<
div
className=
"h-full overflow-y-auto overflow-x-hidden"
ref=
{
chatListDomRef
}
>
<
Chat
chatList=
{
chatList
}
onSend=
{
onSend
}
...
...
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