This commit is contained in:
Adil Hafeez 2024-10-27 21:32:52 -07:00
parent 85aee8c9a8
commit a6a8b63551
2 changed files with 5 additions and 1 deletions

View file

@ -143,10 +143,13 @@ def chat(query: Optional[str], conversation: Optional[List[Tuple[str, str]]], st
history[-1]["model"] = chunk.model
if chunk.choices[0].delta.content:
if not history[-1]["content"]:
history[-1]["content"] = ""
history[-1]["content"] = (
history[-1]["content"] + chunk.choices[0].delta.content
)
history[-1]["tool_calls"] = chunk.choices[0].delta.tool_calls
if chunk.choices[0].delta.tool_calls:
history[-1]["tool_calls"] = chunk.choices[0].delta.tool_calls
if chunk.model and chunk.choices[0].delta.content:
messages[-1] = (

View file

@ -688,6 +688,7 @@ impl StreamContext {
if self.streaming_response {}
self.tool_calls = None;
return self.send_http_response(
StatusCode::OK.as_u16().into(),
vec![("Powered-By", "Katanemo")],