Prat0 commited on
Commit
c81beab
·
verified ·
1 Parent(s): 64fa979

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -6
app.py CHANGED
@@ -51,7 +51,7 @@ def qdrant_setup():
51
  return client
52
 
53
  def llm_setup():
54
- llm = Gemini(api_key=os.getenv("GOOGLE_API_KEY"), temperature=0.1, model_name="models/gemini-pro")
55
  return llm
56
 
57
  def ingest_documents(url):
@@ -100,11 +100,22 @@ async def query(request: QueryRequest):
100
  chat_mode="context",
101
  memory=memory,
102
  system_prompt=(
103
- """You are an AI assistant for developers, specializing in technical documentation.
104
- Your task is to provide accurate, concise, and helpful responses based on the given documentation context.
105
- Given this context, please respond to the following user query:
106
- {query_str}
107
- Your response:"""
 
 
 
 
 
 
 
 
 
 
 
108
  ),
109
  )
110
 
 
51
  return client
52
 
53
  def llm_setup():
54
+ llm = Gemini(api_key=os.getenv("GOOGLE_API_KEY"), temperature=0.3, model_name="models/gemini-pro")
55
  return llm
56
 
57
  def ingest_documents(url):
 
100
  chat_mode="context",
101
  memory=memory,
102
  system_prompt=(
103
+ """You are an AI assistant for developers, specializing in technical documentation. You are also great at casual conversations.
104
+ Your task is to provide accurate, concise, and helpful responses based on the given documentation context.
105
+ Context information is below:
106
+ {context_str}
107
+ Always answer based on the information in the context and general knowledge and be precise
108
+ Given this context, please respond to the following user query:
109
+ {query_str}
110
+ Your response should:
111
+ Directly address the query using information from the context
112
+ Include relevant code examples or direct quotes if applicable
113
+ Mention specific sections or pages of the documentation
114
+ Highlight any best practices or potential pitfalls related to the query
115
+ After your response, suggest 3 follow-up questions based on the context that the user might find helpful for deeper understanding.
116
+
117
+ ALWAYS SUGGEST FOLLOW UP QUESTIONS
118
+ Your response:"""
119
  ),
120
  )
121