Skip to content

Commit

Permalink
update lecture chat pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
isabellagessl authored and sebastianloose committed Nov 11, 2024
1 parent 6891e3c commit 7e0fd5f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
15 changes: 7 additions & 8 deletions app/pipeline/chat/lecture_chat_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self, callback: LectureChatCallback):
# Set the langchain chat model
request_handler = CapabilityRequestHandler(
requirements=RequirementList(
gpt_version_equivalent=3.5,
gpt_version_equivalent=4.5,
context_length=16385,
privacy_compliance=True,
)
Expand Down Expand Up @@ -119,20 +119,19 @@ def __call__(self, dto: LectureChatPipelineExecutionDTO):
prompt_val = self.prompt.format_messages()
self.prompt = ChatPromptTemplate.from_messages(prompt_val)
try:
self.callback.in_progress()
# self.callback.in_progress()
response = (self.prompt | self.pipeline).invoke({})
self.callback.done(
"Generated response",
final_result=response,
tokens=self.tokens,
)
self._append_tokens(self.llm.tokens, PipelineEnum.IRIS_CHAT_LECTURE_MESSAGE)
response_with_citation = self.citation_pipeline(
retrieved_lecture_chunks, response
)
self.tokens.extend(self.citation_pipeline.tokens)
logger.info(f"Response from lecture chat pipeline: {response}")
return response_with_citation
self.callback.done(
"Response created",
final_result=response_with_citation,
tokens=self.tokens,
)
except Exception as e:
self.callback.error(
"Generating interaction suggestions failed.",
Expand Down
16 changes: 8 additions & 8 deletions app/vector_database/lecture_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ def init_lecture_schema(client: WeaviateClient) -> Collection:
if client.collections.exists(LectureSchema.COLLECTION_NAME.value):
collection = client.collections.get(LectureSchema.COLLECTION_NAME.value)

# collection.config.add_property(
# Property(
# name=LectureSchema.COURSE_LANGUAGE.value,
# description="The language of the COURSE",
# data_type=DataType.TEXT,
# index_searchable=False,
# )
# )
#collection.config.add_property(
# Property(
# name=LectureSchema.COURSE_LANGUAGE.value,
# description="The language of the COURSE",
# data_type=DataType.TEXT,
# index_searchable=False,
# )
#)

return collection

Expand Down
5 changes: 0 additions & 5 deletions app/web/status/status_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,6 @@ def __init__(
state=StageStateEnum.NOT_STARTED,
name="Thinking",
),
StageDTO(
weight=20,
state=StageStateEnum.NOT_STARTED,
name="Responding",
),
]
super().__init__(
url,
Expand Down

0 comments on commit 7e0fd5f

Please sign in to comment.