generated from CogitoNTNU/README-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/CogitoNTNU/jarvis
- Loading branch information
Showing
11 changed files
with
97 additions
and
10 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"210453397504": {"user_id": "1", "text": "Samtale fra 2024-11-07:\n{\"chat_summary\":\"The human greeted the AI with 'hi' twice, and the AI responded with 'success' both times.\"}"}, "210453397505": {"user_id": "1", "text": "Samtale fra 2024-11-07:\n{\"chat_summary\":\"The human bought a new red Audi A7 car yesterday.\"}"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from rag import similarity_search | ||
from langchain_core.tools import tool | ||
from langchain_core.tools.structured import StructuredTool | ||
from typing import List, Tuple | ||
|
||
|
||
@tool | ||
def rag_search(query: str)-> List[Tuple[str, float]]: | ||
""" | ||
Use this tool to get relevant conversation history | ||
Args: | ||
query (str): The query to search for | ||
Returns: | ||
List[Tuple[str, float]]: Relevant chat history | ||
""" | ||
result = similarity_search(query, "1") | ||
|
||
return result | ||
|
||
|
||
def get_tool() -> StructuredTool: | ||
return rag_search |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"1": [210453397504, 210453397505]} |