This repository has been archived by the owner on Jun 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Message
OGIOS edited this page Sep 25, 2023
·
1 revision
Message body contains the content and web search process, returned by Bot.chat()
def __init__(self, conversation_id: str, web_search_enabled: bool):
self.error: Exception | None = None
self.conversation_id: str = conversation_id
self.done: bool = False
self.stream_text: List[str] = []
self.final_text: str | None = None
self.web_search_enabled = web_search_enabled
self.web_search_done = False
self.web_search_steps: List = list()
self.web_search_step = -1
self.temp: List[str] = []
self.count = 0
self.threshold = 3
-
stream_text:
content split by chars -
final_text:
the whole text that will be set after the request is done -
web_search_steps:
- one with
message
&args
which is for the actual web search process. - one with
sources
as a list, containstitle
&host
&link
.
- one with
-
web_search_step:
!= len(web_search_steps) - 1
, please seeself.getWebSearchStep
. -
temp & count & threshold:
No need to be concerned, they exist forstream_text
def getWebSearchSteps(self) -> List[dict]
returns self.web_search_steps
.
raises Exception
if self.error != None
def getWebSearchStep(self) -> dict | None
return self.web_search_steps[self.web_search_step]
.
web_search_step
increases each time this function is called
def getText(self) -> List[str]
returns self.stream_text
.
raises Exception
if self.error != None
def getFinalText(self) -> str | None
returns self.final_text
.
raises Exception
if self.error != None
Feel free to ask any questions or share me with your thoughts!