-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from mindsdb/staging
Release 3.0.0
- Loading branch information
Showing
8 changed files
with
201 additions
and
96 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
import mindsdb_sdk | ||
from uuid import uuid4 | ||
import os | ||
|
||
con = mindsdb_sdk.connect() | ||
|
||
open_ai_key = os.getenv('OPENAI_API_KEY') | ||
model_name = 'gpt-4' | ||
|
||
# Now create an agent that will use the model we just created. | ||
agent = con.agents.get('agent_with_retrieval') | ||
agent.add_file('./data/tokaido-rulebook.pdf', 'rule book for the board game takaido') | ||
agent = con.agents.create(name=f'mindsdb_retrieval_agent_{model_name}_{uuid4().hex}', | ||
model='gpt-4') | ||
|
||
agent.add_file('./data/tokaido-rulebook.pdf', 'rule book for the board game Tokaido') | ||
|
||
|
||
print('Ask a question: ') | ||
question = input() | ||
question = "what are the rules for the game takaido?" | ||
answer = agent.completion([{'question': question, 'answer': None}]) | ||
print(answer.content) |
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
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,6 +1,7 @@ | ||
requests | ||
pandas >= 1.3.5 | ||
mindsdb-sql >= 0.13.0, < 0.14.0 | ||
mindsdb-sql >= 0.17.0, < 1.0.0 | ||
docstring-parser >= 0.7.3 | ||
tenacity >= 8.0.1 | ||
openai >= 1.15.0 | ||
sseclient-py >= 1.8.0 |
Oops, something went wrong.