Skip to content

Commit

Permalink
Improve prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
AnniePacheco committed Oct 3, 2024
1 parent ce9b559 commit 87e15cc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
9 changes: 6 additions & 3 deletions backend/managers/RagManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,12 @@ async def retrieve_and_generate(self, collection_name, query, llm) -> str:
persona = await personas_m.retrieve_persona(persona_id)
personality_prompt = persona.description
# Combine the system prompt and context
system_prompt = (os.environ.get('SYSTEM_PROMPT') + "\n\n{context}" +
"\n\nHere is some information about the assistant expertise to help you answer your questions: " +
personality_prompt)
system_prompt = (os.environ.get('SYSTEM_PROMPT') +
"\n\n{context}" +
"\n\nHere is some information about the assistant expertise to help you answer your questions: " + personality_prompt +
".\n\nIf the user asks you a question about the assistant information, example: 'What can you tell me about the assistant?', 'What is the name of the assistant?', 'Who is the assistant?', etc." +
"\n\nPlease answer the question using the following information:\n\n" + personality_prompt
)

prompt = ChatPromptTemplate.from_messages([
("system", system_prompt),
Expand Down
1 change: 0 additions & 1 deletion backend/managers/ResourcesManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ async def get_ollama_installed_models(self) ->List:
if response.status_code == 200:
data = response.json()
models = data.get("models", [])
print(models)
return models
else:
return []
1 change: 0 additions & 1 deletion backend/managers/VoicesFacesManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ async def text_to_speech(self, voice_id: str, body: str, assistant_id: str, msg_
directory.mkdir(parents=True, exist_ok=True)
file_path = directory / f'{msg_id}.mp3'
audio_msg_path = str(file_path)
print('audio_msg_path: ', audio_msg_path)
tts_url = f"https://api.elevenlabs.io/v1/text-to-speech/{xi_id}/stream"

headers = {
Expand Down

0 comments on commit 87e15cc

Please sign in to comment.