Commit cefc5ae1 authored by Joel's avatar Joel

feat: merge

parents 7e2d45d9 32ef9c89
...@@ -157,7 +157,7 @@ class BaseVectorIndex(BaseIndex): ...@@ -157,7 +157,7 @@ class BaseVectorIndex(BaseIndex):
documents.append(document) documents.append(document)
origin_index_struct = self.dataset.index_struct origin_index_struct = self.dataset.index_struct[:]
self.dataset.index_struct = None self.dataset.index_struct = None
if documents: if documents:
......
from typing import Optional, cast from typing import Optional, cast
import requests
import weaviate import weaviate
from langchain.embeddings.base import Embeddings from langchain.embeddings.base import Embeddings
from langchain.schema import Document, BaseRetriever from langchain.schema import Document, BaseRetriever
...@@ -34,12 +35,15 @@ class WeaviateVectorIndex(BaseVectorIndex): ...@@ -34,12 +35,15 @@ class WeaviateVectorIndex(BaseVectorIndex):
weaviate.connect.connection.has_grpc = False weaviate.connect.connection.has_grpc = False
try:
client = weaviate.Client( client = weaviate.Client(
url=config.endpoint, url=config.endpoint,
auth_client_secret=auth_config, auth_client_secret=auth_config,
timeout_config=(5, 60), timeout_config=(5, 60),
startup_period=None startup_period=None
) )
except requests.exceptions.ConnectionError:
raise ConnectionError("Vector database connection error")
client.batch.configure( client.batch.configure(
# `batch_size` takes an `int` value to enable auto-batching # `batch_size` takes an `int` value to enable auto-batching
......
...@@ -65,8 +65,8 @@ class ChatClient(DifyClient): ...@@ -65,8 +65,8 @@ class ChatClient(DifyClient):
return self._send_request("GET", "/messages", params=params) return self._send_request("GET", "/messages", params=params)
def get_conversations(self, user, first_id=None, limit=None, pinned=None): def get_conversations(self, user, last_id=None, limit=None, pinned=None):
params = {"user": user, "first_id": first_id, "limit": limit, "pinned": pinned} params = {"user": user, "last_id": last_id, "limit": limit, "pinned": pinned}
return self._send_request("GET", "/conversations", params=params) return self._send_request("GET", "/conversations", params=params)
def rename_conversation(self, conversation_id, name, user): def rename_conversation(self, conversation_id, name, user):
......
...@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh: ...@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
setup( setup(
name="dify-client", name="dify-client",
version="0.1.7", version="0.1.8",
author="Dify", author="Dify",
author_email="hello@dify.ai", author_email="hello@dify.ai",
description="A package for interacting with the Dify Service-API", description="A package for interacting with the Dify Service-API",
......
...@@ -352,10 +352,12 @@ const Answer: FC<IAnswerProps> = ({ item, feedbackDisabled = false, isHideFeedba ...@@ -352,10 +352,12 @@ const Answer: FC<IAnswerProps> = ({ item, feedbackDisabled = false, isHideFeedba
} }
</div> </div>
<div className='absolute top-[-14px] right-[-14px] flex flex-row justify-end gap-1'> <div className='absolute top-[-14px] right-[-14px] flex flex-row justify-end gap-1'>
{!item.isOpeningStatement && (
<CopyBtn <CopyBtn
value={content} value={content}
className={cn(s.copyBtn, 'mr-1')} className={cn(s.copyBtn, 'mr-1')}
/> />
)}
{!feedbackDisabled && !item.feedbackDisabled && renderItemOperation(displayScene !== 'console')} {!feedbackDisabled && !item.feedbackDisabled && renderItemOperation(displayScene !== 'console')}
{/* Admin feedback is displayed only in the background. */} {/* Admin feedback is displayed only in the background. */}
{!feedbackDisabled && renderFeedbackRating(localAdminFeedback?.rating, false, false)} {!feedbackDisabled && renderFeedbackRating(localAdminFeedback?.rating, false, false)}
...@@ -487,7 +489,7 @@ const Chat: FC<IChatProps> = ({ ...@@ -487,7 +489,7 @@ const Chat: FC<IChatProps> = ({
}, [suggestionList]) }, [suggestionList])
return ( return (
<div className={cn(!feedbackDisabled && 'px-3.5', 'h-full')}> <div className={cn('px-3.5', 'h-full')}>
{/* Chat List */} {/* Chat List */}
<div className="h-full space-y-[30px]"> <div className="h-full space-y-[30px]">
{chatList.map((item) => { {chatList.map((item) => {
......
...@@ -370,8 +370,7 @@ const Debug: FC<IDebug> = ({ ...@@ -370,8 +370,7 @@ const Debug: FC<IDebug> = ({
{mode === AppType.chat && ( {mode === AppType.chat && (
<div className="mt-[34px] h-full flex flex-col"> <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={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}> <div className="h-full overflow-y-auto overflow-x-hidden" ref={chatListDomRef}>
{/* {JSON.stringify(chatList)} */}
<Chat <Chat
chatList={chatList} chatList={chatList}
onSend={onSend} onSend={onSend}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment