From 8ab6cb33eda44db763ed582e7669da5b83a04c7e Mon Sep 17 00:00:00 2001 From: Karthik Kannappan <5559670+karthikkannappan@users.noreply.github.com> Date: Fri, 9 Aug 2024 16:04:10 -0400 Subject: [PATCH 1/3] Updating API versions to reflect the latest h2ogpte --- company-financial-overview/requirements.txt | 2 +- company-financial-overview/src/generate_content.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/company-financial-overview/requirements.txt b/company-financial-overview/requirements.txt index e500842..fab4bfc 100644 --- a/company-financial-overview/requirements.txt +++ b/company-financial-overview/requirements.txt @@ -1,4 +1,4 @@ -h2ogpte==1.4.9 +h2ogpte==1.5.10 h2o_wave loguru toml diff --git a/company-financial-overview/src/generate_content.py b/company-financial-overview/src/generate_content.py index 1bdb0f5..94b60c1 100644 --- a/company-financial-overview/src/generate_content.py +++ b/company-financial-overview/src/generate_content.py @@ -125,7 +125,7 @@ def stream_response(message): client = H2OGPTE(address=os.getenv("H2OGPTE_URL"), api_key=os.getenv("H2OGPTE_API_TOKEN")) collection_id = client.create_collection("Temp for Company Financial Overview", "") - chat_session_id = client.create_chat_session(collection_id) + chat_session_id = client.create_chat_session(collection_id=collection_id) print("USER MESSSAGEEEEE", chatbot_interaction.user_message) with client.connect(chat_session_id) as session: session.query( From 79e3dc63be51e35c019f395dc242dc4021c6cc09 Mon Sep 17 00:00:00 2001 From: Karthik Kannappan <5559670+karthikkannappan@users.noreply.github.com> Date: Fri, 9 Aug 2024 16:10:26 -0400 Subject: [PATCH 2/3] Bump up app version --- company-financial-overview/app.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/company-financial-overview/app.toml b/company-financial-overview/app.toml index 39cc6ca..0dd16b4 100644 --- a/company-financial-overview/app.toml +++ b/company-financial-overview/app.toml @@ -1,6 +1,6 @@ [App] Name = "ai.h2o.wave.company_info_at_a_glance" -Version = "0.0.6" +Version = "0.0.7" Title = "Company Information" Description = "Use AI to research companies and identify opportunities" Tags = ["GENERATIVE_AI", "DATA_SCIENCE", "OSS"] From 3324d8124b20cd94304eebf948148fb8dcdfefdb Mon Sep 17 00:00:00 2001 From: Karthik Kannappan <5559670+karthikkannappan@users.noreply.github.com> Date: Fri, 9 Aug 2024 20:35:50 -0400 Subject: [PATCH 3/3] Some changes to the competitor prompt to get to the point and avoid things like 'sure I can help', and filtering out the ####LLM Only message --- company-financial-overview/prompts/competitor_prompt.txt | 2 +- company-financial-overview/src/generate_content.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/company-financial-overview/prompts/competitor_prompt.txt b/company-financial-overview/prompts/competitor_prompt.txt index dcfd278..487a52e 100644 --- a/company-financial-overview/prompts/competitor_prompt.txt +++ b/company-financial-overview/prompts/competitor_prompt.txt @@ -1 +1 @@ -Who are the main competitors for the company provided? Can you list them by market cap and number of employees? \ No newline at end of file +Who are the main competitors for the company provided? Please list them by market cap and number of employees? \ No newline at end of file diff --git a/company-financial-overview/src/generate_content.py b/company-financial-overview/src/generate_content.py index 94b60c1..9d5e63e 100644 --- a/company-financial-overview/src/generate_content.py +++ b/company-financial-overview/src/generate_content.py @@ -159,6 +159,6 @@ def update_response(self, message): self.content_to_show = message.content self.responding = False elif isinstance(message, PartialChatMessage): - if message.content != "#### LLM Only (no RAG):\n": + if message.content != "#### LLM Only:\n": self.llm_response += message.content self.content_to_show = self.llm_response + " 🟡"