Validated Bigframes.pands package to query BQ#1
Conversation
|
|
||
| # csv-agent | ||
|
|
||
| This template uses a [csv agent](https://python.langchain.com/docs/integrations/toolkits/csv) with tools (Python REPL) and memory (vectorstore) for interaction (question-answering) with text data. |
There was a problem hiding this comment.
Need some docs on bq-agent
| ) | ||
| tools = [repl, retriever_tool] | ||
| agent = OpenAIFunctionsAgent( | ||
| llm=ChatOpenAI(temperature=0, model="gpt-4"), prompt=prompt, tools=tools |
There was a problem hiding this comment.
this model doesn't have a large context window (8k ?)
| from langchain.indexes import VectorstoreIndexCreator | ||
| from langchain.vectorstores import FAISS | ||
|
|
||
| loader = CSVLoader("/Users/harrisonchase/Downloads/titanic.csv") |
There was a problem hiding this comment.
this file is not needed?
| @@ -0,0 +1,37 @@ | |||
| [tool.poetry] | |||
| name = "csv-agent" | |||
There was a problem hiding this comment.
this needs to be updated to bq_agent for langserve to work
| langchain-cli = ">=0.0.15" | ||
|
|
||
| [tool.langserve] | ||
| export_module = "csv_agent" |
There was a problem hiding this comment.
this needs updating too, to bq_agent
MarkEdmondson1234
left a comment
There was a problem hiding this comment.
@alexhumpy98 can the bq_agent/dev folder be ignored too?
There was a problem hiding this comment.
❌ Changes requested.
- Reviewed the entire pull request up to 63a7879
- Looked at
181lines of code in8files - Took 1 minute and 26 seconds to review
More info
- Skipped
6files when reviewing. - Skipped posting
4additional comments because they didn't meet confidence threshold of50%.
1. /langserve/packages/bq-agent/bq_agent/agent.py:21:
- Assessed confidence :
100% - Grade:
0% - Comment:
Consider parameterizing the SQL query or making it more dynamic to increase the flexibility and robustness of the agent. - Reasoning:
The bq_agent/agent.py file contains a hardcoded SQL query. This could be a problem if the table structure or the database changes. It also limits the flexibility of the agent.
2. /langserve/packages/bq-agent/bq_agent/agent.py:27:
- Assessed confidence :
100% - Grade:
0% - Comment:
Consider removing the hardcoded question or making it more dynamic to increase the flexibility of the agent. - Reasoning:
The bq_agent/agent.py file contains a hardcoded question 'How many rows are there in this dataframe?'. This could be a problem if the agent is supposed to handle different types of questions.
3. /langserve/packages/bq-agent/ingest.py:5:
- Assessed confidence :
100% - Grade:
0% - Comment:
Consider parameterizing the file path or making it more dynamic to increase the flexibility and robustness of the agent. - Reasoning:
The ingest.py file contains a hardcoded path to a CSV file. This could be a problem if the file location changes or if the agent is supposed to handle different files.
4. /langserve/packages/bq-agent/main.py:4:
- Assessed confidence :
100% - Grade:
0% - Comment:
Consider removing the hardcoded question or making it more dynamic to increase the flexibility of the agent. - Reasoning:
The main.py file contains a hardcoded question 'how many unique users are there?'. This could be a problem if the agent is supposed to handle different types of questions.
Workflow ID: wflow_uKs5hpo0BST7zUD7
Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. We'll respond in a few minutes. Learn more here.
| @@ -0,0 +1,71 @@ | |||
|
|
|||
| # csv-agent | |||
There was a problem hiding this comment.
The title of the README.md file should be updated to reflect the correct package name. Consider changing 'csv-agent' to 'bq-agent'.
| @@ -0,0 +1 @@ | |||
| {"username":"alexanderhumpert","key":"ecebeed6b450fd85320b282a494866bd"} No newline at end of file | |||
There was a problem hiding this comment.
Sensitive information such as usernames and keys should not be stored in plaintext. Consider using environment variables or a secure method of storing these values.
Summary:
This PR introduces a new 'BQ-agent' that reads a BigQuery table into a pandas dataframe, creates a pandas dataframe agent, and provides instructions on how to use the new package.
Key points:
agent.pyfile reads a BigQuery table into a pandas dataframe using thebigframes.pandaspackage.ingest.pyfile creates a vectorstore index from a CSV file.main.pyfile invokes the agent executor with a question.kaggle.jsonfile contains sensitive information and should be removed.csv_agent/agent.pyfile is just a newline at the end of the file.Generated with ❤️ by ellipsis.dev