Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load and examples scripts #1472

Closed
wants to merge 2 commits into from
Closed

load and examples scripts #1472

wants to merge 2 commits into from

Conversation

gdcsinaptik
Copy link
Collaborator

@gdcsinaptik gdcsinaptik commented Dec 13, 2024

Important

Add new example scripts for pandasai usage and update dependencies in pyproject.toml.

  • Examples:
    • Add load_df.py to demonstrate loading datasets with pandasai.load() using virtualized option.
    • Add quickstart.py to show reading CSV, asking questions, and plotting with df.chat().
    • Add save_csv.py to demonstrate saving datasets with field descriptions using df.save().
    • Add use_openai.py to configure and use OpenAI LLM with pandasai.
  • Dependencies:
    • Add pyarrow to pyproject.toml dependencies.

This description was created by Ellipsis for be91d4a. It will automatically update as commits are pushed.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 13, 2024
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to be91d4a in 47 seconds

More details
  • Looked at 177 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. new_examples/load_df.py:5
  • Draft comment:
    Avoid hardcoding API keys and URLs. Use environment variables or configuration files to manage them securely.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. new_examples/quickstart.py:5
  • Draft comment:
    Avoid hardcoding API keys and URLs. Use environment variables or configuration files to manage them securely.
  • Reason this comment was not posted:
    Marked as duplicate.
3. new_examples/save_csv.py:5
  • Draft comment:
    Avoid hardcoding API keys and URLs. Use environment variables or configuration files to manage them securely.
  • Reason this comment was not posted:
    Marked as duplicate.
4. new_examples/use_openai.py:6
  • Draft comment:
    Avoid hardcoding API keys and URLs. Use environment variables or configuration files to manage them securely.
  • Reason this comment was not posted:
    Marked as duplicate.
5. new_examples/use_openai.py:8
  • Draft comment:
    Avoid hardcoding API tokens. Use environment variables or configuration files to manage them securely.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_cNDmdPq1oz8gJgiW


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

new_examples/save_csv.py Outdated Show resolved Hide resolved
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
import os
import pandasai as pai

os.environ["PANDASAI_API_URL"] = "http://localhost:8000/"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gdcsinaptik I'd remove this as it's not meant to be committed. The default value should be used by default

import os
import pandasai as pai

os.environ["PANDASAI_API_URL"] = "http://localhost:8000/"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gdcsinaptik I'd remove this as it's not meant to be committed. The default value should be used by default

# Print LLM details
print("LLM Type:", type(llm).__name__)
print("LLM Instance:", llm)
print("LLM Model:", llm.model)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gdcsinaptik why are we printing these?

print("\nCurrent PandasAI Config:")
print("Active LLM:", pai.config._config.llm)

df = pai.load("/home/giuseppe/Projects/pandas-ai/datasets/testing/loans")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gdcsinaptik this is wrong

@gventuri gventuri closed this Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants