Skip to content

Commit

Permalink
Adjust prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
kaancayli committed Mar 6, 2024
1 parent c3b11ba commit 10d10ee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions app/pipeline/chat/file_selector_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __call__(
:param query: The query
:return: Selected file content
"""
print("Running file selector pipeline...")
logger.info("Running file selector pipeline...")
if prompt is None:
prompt = self.default_prompt

Expand All @@ -88,5 +88,4 @@ def __call__(
"files": file_list,
}
)
print(response)
return response.selected_files
5 changes: 0 additions & 5 deletions app/pipeline/chat/tutor_chat_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ def __call__(self, dto: TutorChatPipelineExecutionDTO, **kwargs):
if submission:
self._add_build_logs_to_prompt(build_logs, build_failed)

self._add_feedbacks_to_prompt(feedbacks)

self._add_exercise_context_to_prompt(
submission,
selected_files,
Expand All @@ -125,11 +123,8 @@ def __call__(self, dto: TutorChatPipelineExecutionDTO, **kwargs):
self.prompt = ChatPromptTemplate.from_messages(prompt_val)
response_draft = (self.prompt | self.pipeline).invoke({})
self.prompt += AIMessagePromptTemplate.from_template(f"{response_draft}")
print(f"Prompt: {self.prompt.format_prompt().to_string()}")
self.prompt += SystemMessagePromptTemplate.from_template(guide_system_prompt)
response = (self.prompt | self.pipeline).invoke({})
print(f"Response draft: {response_draft}")
print(f"Response: {response}")
logger.debug(f"Response from tutor chat pipeline: {response}")
stages.append(
StageDTO(
Expand Down
2 changes: 2 additions & 0 deletions app/pipeline/prompts/iris_tutor_chat_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@
- The response must not perform any work the student is supposed to do.
- DO NOT UNDER ANY CIRCUMSTANCES repeat any previous messages in the chat history.
Your messages must ALWAYS BE NEW AND ORIGINAL
- It's also important that the rewritten response still follows the general guidelines for the conversation with the
student and a conversational style.
Here are examples of response drafts that already adheres to the rules and does not need to be rewritten:
Expand Down

0 comments on commit 10d10ee

Please sign in to comment.