Skip to content

Commit

Permalink
chat uses plugins .-.
Browse files Browse the repository at this point in the history
  • Loading branch information
josancamon19 committed Nov 13, 2024
1 parent 9b0a72c commit 364a392
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/utils/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def qa_rag(uid: str, question: str, context: str, plugin: Optional[Plugin] = Non
```
Answer:
""".replace(' ', '').strip()
print('QA Using context:', context)
# print('qa_rag prompt', prompt)
return llm_mini.invoke(prompt).content


Expand Down
2 changes: 2 additions & 0 deletions backend/utils/retrieval/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def determine_conversation_type(
s: GraphState,
) -> Literal["no_context_conversation", "context_dependent_conversation", "no_context_omi_question"]:
is_omi_question = retrieve_is_an_omi_question(s.get("messages", []))
# TODO: after asked many questions this is causing issues.
if is_omi_question:
return "no_context_omi_question"

Expand Down Expand Up @@ -193,6 +194,7 @@ def qa_handler(state: GraphState):

@timeit
def execute_graph_chat(uid: str, messages: List[Message], plugin: Optional[Plugin]) -> Tuple[str, bool, List[Memory]]:
print('execute_graph_chat plugin :', plugin)
result = graph.invoke(
{"uid": uid, "messages": messages, "plugin_selected": plugin},
{"configurable": {"thread_id": str(uuid.uuid4())}},
Expand Down

0 comments on commit 364a392

Please sign in to comment.