Skip to content

Commit 690ab84

Browse files
committed
finalizing v0.0.2
1 parent 478796f commit 690ab84

File tree

4 files changed

+7
-22
lines changed

4 files changed

+7
-22
lines changed

prompt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def firePrompt(prompt: str, model: str="dolphin-mistral:latest", temp=0.4, isMlx
2727
if isMlx:
2828
res = f'Search not implemented for MlX models. Stay tuned!'
2929
else:
30-
res, keywords = retSearchResults(model=model, search_str=prompt)
30+
res, keywords = retSearchResults(model=model, search_str=prompt, temp=temp)
3131
except Exception as e:
3232
return f'__Generic Error Occured__ {e}', ""
3333
return res, keywords

prompts.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
system_prompt = f"""
2-
You are a helpful assistant capable of chatting with user and also perform a web research if required. Answer all questions truthfully to the best you can. If and only if you cannot answer the user_prompt, then use the information available in search_text to summarize an answer for the the user_prompt. While generating the summary, cite the source from the given search_text by converting the citation as a clickable text using markdown format.
2+
You are a helpful assistant capable of chatting with user and also perform a web research if required. Answer all questions truthfully to the best you can. If and only if you cannot answer the user_prompt, then use the information available in search_text to summarize an answer for the the user_prompt. While generating the summary, always cite the source from the given search_text by converting the citation as a clickable text using markdown format.
33

44
search_text :
55
user_prompt :

roadmap.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

search.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
search = DuckDuckGoSearchResults(api_wrapper=wrapper)
77

88
search_prompt = f"""
9-
You are a helpful assistant capable of performing a web research. If the user_prompt is not an instruction, task or question, donot proceed to summarize. Instead, politely request the user that you cannot engage in general chat. If not, Use the information available in search_text to summarize an answer for the the user_prompt. While generating the summary, cite the sources from the search_text by converting the citation as a hyperlink using markdown format.
9+
You are a helpful assistant capable of performing a web research. If the user_prompt is not an instruction, task or question, donot proceed to summarize. Instead, politely request the user that you cannot engage in general chat. If not, Use the information available in search_text to summarize an answer for the the user_prompt. While generating the summary, always cite the sources from the search_text by converting the citation as a hyperlink using markdown format.
1010
1111
search_text :
1212
user_prompt :
@@ -25,11 +25,11 @@ def retPrompt(res, up):
2525
"""
2626
return tprompt
2727

28-
def retSearchResults(model: str = "", search_str: str = "") -> str:
29-
keywords_llm = Ollama(model=model, system=keyword_prompt)
28+
def retSearchResults(model: str = "", search_str: str = "", temp=0.4) -> str:
29+
keywords_llm = Ollama(model=model, system=keyword_prompt, temperature=temp)
3030
query_str = keywords_llm.invoke(f'input_text : \n {search_str}')
3131
print(f'Keywords for this search texts are {query_str}')
32-
search_llm = Ollama(model=model, system=search_prompt)
32+
search_llm = Ollama(model=model, system=search_prompt, temperature=temp)
3333
searchResults = search.run(query_str)
34-
response = search_llm.invoke(retPrompt(searchResults, search_str))
34+
response = search_llm.invoke(retPrompt(searchResults, search_str), temperature=temp)
3535
return response, query_str

0 commit comments

Comments
 (0)