-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
7 additions
and
8 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 |
---|---|---|
@@ -1,18 +1,17 @@ | ||
import os | ||
|
||
from pandasai.agent.agent import Agent | ||
from pandasai.ee.agents.security_agent import SecurityAgent | ||
from pandasai.ee.agents.advanced_security_agent import AdvancedSecurityAgent | ||
from pandasai.llm.openai import OpenAI | ||
|
||
os.environ["PANDASAI_API_KEY"] = "$2a****************************" | ||
|
||
security = SecurityAgent() | ||
security = AdvancedSecurityAgent() | ||
agent = Agent("github-stars.csv", security=security) | ||
|
||
print(agent.chat("return total stars count")) | ||
|
||
print(agent.chat("return all the folders in the root directory")) | ||
|
||
# Using Security standalone | ||
llm = OpenAI("openai_key") | ||
security = SecurityAgent(config={"llm": llm}) | ||
security.evaluate("return total github star count for year 2023") | ||
security = AdvancedSecurityAgent(config={"llm": llm}) | ||
security.evaluate("return all the folders in the root directory") |
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