add comments

This commit is contained in:
Adil Hafeez 2024-10-28 23:41:08 -07:00
parent fb476d37d5
commit e8498f5d25
2 changed files with 4 additions and 1 deletions

View file

@ -1,5 +1,6 @@
import json
import logging
import os
import yaml
logging.basicConfig(

View file

@ -83,7 +83,9 @@ def chat(query: Optional[str], conversation: Optional[List[Tuple[str, str]]], st
if message.content:
history[-1]["content"] = history[-1].get("content", "") + message.content
if history[-1]["role"] != "tool" and message.content:
# message.content is none for tool calls
# when "role = tool" content would contain api call response
if message.content and history[-1]["role"] != "tool":
conversation[-1] = (
conversation[-1][0],
conversation[-1][1] + message.content,