Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
bassner committed Jun 23, 2024
1 parent 55f0a01 commit 3d2efb8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 16 deletions.
4 changes: 0 additions & 4 deletions app/pipeline/chat/code_feedback_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os
from typing import Dict, Optional, List

from langchain.output_parsers import PydanticOutputParser
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import PromptTemplate
from langchain_core.runnables import Runnable
Expand All @@ -16,9 +15,6 @@
from ...llm import CompletionArguments
from ...llm.langchain import IrisLangchainChatModel
from ...pipeline import Pipeline
from ...pipeline.chat.output_models.output_models.selected_file_model import (
SelectedFiles,
)
from ...web.status.status_update import StatusCallback

logger = logging.getLogger(__name__)
Expand Down
4 changes: 0 additions & 4 deletions app/pipeline/chat/course_chat_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
from app.domain.chat.interaction_suggestion_dto import (
InteractionSuggestionPipelineExecutionDTO,
)
from ...domain.chat.lecture_chat.lecture_chat_pipeline_execution_dto import (
LectureChatPipelineExecutionDTO,
)
from ...domain.data.course_dto import CourseDTO
from ...llm import CapabilityRequestHandler, RequirementList
from ..prompts.iris_course_chat_prompts import (
tell_iris_initial_system_prompt,
Expand Down
4 changes: 2 additions & 2 deletions app/pipeline/chat/exercise_chat_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import json
import logging
import traceback
from concurrent.futures import ThreadPoolExecutor
Expand Down Expand Up @@ -202,7 +201,8 @@ def _run_exercise_chat_pipeline(
"(the student should think it's your own idea)! "
"\n" + feedback + "\n"
"Remember: This is not coming from the student. This is not a message from the student. "
"Is is an automated analysis of the student's code. NEVER claim that the student said this, e.g with 'You mentioned...'"
"Is is an automated analysis of the student's code. "
"NEVER claim that the student said this, e.g with 'You mentioned...'"
)
except Exception as e:
self.callback.error(
Expand Down
6 changes: 4 additions & 2 deletions app/pipeline/prompts/iris_interaction_suggestion_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@
course_chat_history_exists_prompt = """
The following messages represent the chat history of your conversation with the student so far.
Use it to generate questions that are consistent with the conversation and informed by the student's progress.
Important: The generated questions should be based on the chat history. They should be suggestions for natural follow-up questions or statements like a student would ask a human tutor.
Important: The generated questions should be based on the chat history. They should be suggestions for natural follow-up
questions or statements like a student would ask a human tutor.
The questions should be engaging, insightful so that the student continues to engage in the conversation.
Avoid repeating or reusing previous questions or messages; always in all circumstances craft new and original questions.
Never re-use any questions that are already asked. Instead, always write new and original questions.
Expand All @@ -130,7 +131,8 @@
The following messages represent the chat history of your conversation with the student so far.
Use it to generate questions that are consistent with the conversation and informed by the student's progress
in the exercise.
Important: The generated questions should be related to the chat history. They should be suggestions for natural follow-up questions or statements like a student would ask a human tutor.
Important: The generated questions should be related to the chat history. They should be suggestions for natural
follow-up questions or statements like a student would ask a human tutor.
The questions should be engaging, insightful so that the student continues to engage in the conversation.
Avoid repeating or reusing previous questions or messages; always in all circumstances craft new and original questions.
Never re-use any questions that are already asked. Instead, always write new and original questions.
Expand Down
8 changes: 5 additions & 3 deletions app/pipeline/prompts/lecture_retrieval_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
You decide if a student question to an AI tutor is a contentful question or not.
A contentful question is a question that is not a greeting, a thank you, or a statement.
It is only contentful if it can be potentially answered by looking into the lecture materials.
If the question is contentful, return 'YES'. If the question is not contentful and a lecture lookup is probably useless, return 'NO'.
If the question is contentful, return 'YES'. If the question is not contentful and a lecture lookup is probably useless,
return 'NO'.
"""

assessment_prompt_final = """
Now, decide if the student question is a contentful question or not.
A contentful question is a question that is not a greeting, a thank you, or a statement.
It is only contentful if it can be potentially answered by looking into the lecture materials.
If the question is contentful, return 'YES'. If the question is not contentful and a lecture lookup is probably useless, return 'NO'.
If the question is contentful, return 'YES'. If the question is not contentful and a lecture lookup is probably useless,
return 'NO'.
Do not answer the question. Only return 'YES' or 'NO'.
"""

Expand All @@ -28,7 +30,7 @@
You write good and performant vector database queries, in particular for Weaviate,
from chat histories between an AI tutor and a student.
The student has sent a query in the context of the lecture {course_name} and the exercise {exercise_name}.
For more exercise context here is the problem statement:
For more exercise context here is the problem statement:
---
{problem_statement}
---
Expand Down
2 changes: 1 addition & 1 deletion app/pipeline/shared/citation_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
from asyncio.log import logger
from typing import Optional, List, Union
from typing import List, Union

from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate, PromptTemplate
Expand Down

0 comments on commit 3d2efb8

Please sign in to comment.