ofermend commited on
Commit
f4b6a82
1 Parent(s): b9b8dd6
Files changed (2) hide show
  1. app.py +6 -5
  2. requirements.txt +0 -1
app.py CHANGED
@@ -4,12 +4,13 @@ import streamlit as st
4
  import os
5
  from PIL import Image
6
  import sys
7
- import datetime
8
  import requests
9
- from dotenv import load_dotenv
10
  from typing import Tuple
11
  from bs4 import BeautifulSoup
12
 
 
 
 
13
  from pydantic import Field, BaseModel
14
  from vectara_agent.agent import Agent, AgentStatusType
15
  from vectara_agent.tools import ToolsFactory
@@ -17,8 +18,6 @@ from vectara_agent.tools_catalog import summarize_text
17
 
18
  initial_prompt = "How can I help you today?"
19
 
20
- load_dotenv(override=True)
21
-
22
  get_headers = {
23
  "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0",
24
  "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
@@ -166,7 +165,9 @@ def initialize_agent(_cfg):
166
  bot_instructions = """
167
  - You are a helpful assistant, with expertise in answering user questions about Hacker News stories and comments.
168
  - Never discuss politics, and always respond politely.
169
- - When links are included in your response, make sure they have proper titles, so the user knows what to expect.
 
 
170
  """
171
 
172
  def update_func(status_type: AgentStatusType, msg: str):
 
4
  import os
5
  from PIL import Image
6
  import sys
 
7
  import requests
 
8
  from typing import Tuple
9
  from bs4 import BeautifulSoup
10
 
11
+ from dotenv import load_dotenv
12
+ load_dotenv(override=True)
13
+
14
  from pydantic import Field, BaseModel
15
  from vectara_agent.agent import Agent, AgentStatusType
16
  from vectara_agent.tools import ToolsFactory
 
18
 
19
  initial_prompt = "How can I help you today?"
20
 
 
 
21
  get_headers = {
22
  "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0",
23
  "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
 
165
  bot_instructions = """
166
  - You are a helpful assistant, with expertise in answering user questions about Hacker News stories and comments.
167
  - Never discuss politics, and always respond politely.
168
+ - This is important: when you include links to Hacker News stories, use the actual title of the story as the link's displayed text.
169
+ Don't use text like "Source" which doesn't tell the user what the link is about.
170
+ - Give slight preference to newer stories when answering questions.
171
  """
172
 
173
  def update_func(status_type: AgentStatusType, msg: str):
requirements.txt CHANGED
@@ -1,5 +1,4 @@
1
  omegaconf==2.3.0
2
  streamlit==1.32.2
3
  pydantic==1.10.15
4
- python-dotenv==1.0.1
5
  git+https://{GITHUB_TOKEN}@github.com/vectara/vectara-agent.git
 
1
  omegaconf==2.3.0
2
  streamlit==1.32.2
3
  pydantic==1.10.15
 
4
  git+https://{GITHUB_TOKEN}@github.com/vectara/vectara-agent.git