This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
-
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.
Showing
16 changed files
with
970 additions
and
55 deletions.
There are no files selected for viewing
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 @@ | ||
from .agent import Agent |
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,22 @@ | ||
from falkordb_gemini_kg.kg import KnowledgeGraph | ||
|
||
|
||
class Agent(object): | ||
|
||
@property | ||
def agent_id(self) -> str: | ||
pass | ||
|
||
@property | ||
def introduction(self) -> str: | ||
pass | ||
|
||
@property | ||
def _schema(self) -> list[dict]: | ||
pass | ||
|
||
def run(self, params: dict): | ||
pass | ||
|
||
def to_orchestrator(self): | ||
pass |
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,60 @@ | ||
from falkordb_gemini_kg.kg import KnowledgeGraph | ||
from .agent import Agent | ||
|
||
|
||
class KGAgent(Agent): | ||
|
||
_schema = [ | ||
{ | ||
"name": "prompt", | ||
"type": "string", | ||
"required": True, | ||
"description": "The prompt to ask the agent.", | ||
} | ||
] | ||
|
||
def __init__(self, agent_id: str, kg: KnowledgeGraph, introduction: str): | ||
super().__init__() | ||
self.agent_id = agent_id | ||
self.introduction = introduction | ||
self.kg = kg | ||
|
||
@property | ||
def agent_id(self) -> str: | ||
return self._agent_id | ||
|
||
@agent_id.setter | ||
def agent_id(self, value): | ||
self._agent_id = value | ||
|
||
@property | ||
def introduction(self) -> str: | ||
return self._introduction | ||
|
||
@introduction.setter | ||
def introduction(self, value): | ||
self._introduction = value | ||
|
||
@property | ||
def _schema(self) -> list[dict]: | ||
return self._schema | ||
|
||
@property | ||
def kg(self) -> KnowledgeGraph: | ||
return self._kg | ||
|
||
@kg.setter | ||
def kg(self, value): | ||
self._kg = value | ||
|
||
def run(self, params: dict): | ||
return self._kg.ask(params["prompt"]) | ||
|
||
def to_orchestrator(self): | ||
return f""" | ||
--- | ||
Agent ID: {self.agent_id} | ||
Knowledge Graph Name: {self._kg.name} | ||
Introduction: {self.introduction} | ||
""" |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.