Sinaptik-AI / pandas-ai

Chat with your database (SQL, CSV, pandas, polars, mongodb, noSQL, etc). PandasAI makes data analysis conversational using LLMs (GPT 3.5 / 4, Anthropic, VertexAI) and RAG.
https://pandas-ai.com
Other
12.54k stars 1.21k forks source link

Is that a must to use the Docker component if I am using the agent function? #1310

Open rogerlpag opened 1 month ago

rogerlpag commented 1 month ago

System Info

What's the need of the docker if i am not relying on the front hand? / doesn't need the front end.

🐛 Describe the bug

I am using my openAI model is there a need to spin up the docker?

dosubot[bot] commented 1 month ago

No, it is not necessary to use the Docker component if you are using the agent function and do not need a front end. You can use the Agent class directly in Python without any mention of Docker or a front end [1].

To continue talking to Dosu, mention @dosu.

rogerlpag commented 1 month ago

If so , what's this error about

Exception in APILogger: HTTPSConnectionPool(host='api.domer.ai', port=443): Max retries exceeded with url: /api/log/add (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)')))

From: dosubot[bot] @.> Sent: Monday, August 5, 2024 2:53 PM To: Sinaptik-AI/pandas-ai @.> Cc: Roger Leung @.>; Author @.> Subject: Re: [Sinaptik-AI/pandas-ai] Is that a must to use the Docker component if I am using the agent function? (Issue #1310)

EXTERNAL

No, it is not necessary to use the Docker component if you are using the agent function and do not need a front end. You can use the Agent class directly in Python without any mention of Docker or a front end [1]https://github.com/Sinaptik-AI/pandas-ai/blob/main/examples/agent.py.

To continue talking to Dosuhttps://dosu.dev/, mention @dosuhttps://github.com/dosu.

- Reply to this email directly, view it on GitHubhttps://github.com/Sinaptik-AI/pandas-ai/issues/1310#issuecomment-2268307549, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BD2EHIGN2OXZC4IM2IKLZKTZP4OLNAVCNFSM6AAAAABL7UYLBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRYGMYDONJUHE. You are receiving this because you authored the thread.Message ID: @.***>


The information contained in this email (including all attached files) is confidential and may be legally privileged. If you are not the intended recipient, you may not disclose or use the information in this email in any way. If you have received this email in error, please notify us immediately by return e-mail and delete the email and all attachments from your system. Please follow the attached URL to an important disclosure regarding our firm's privacy policy: https://www.pag.com/en/privacy-policy Thank you.

dosubot[bot] commented 1 month ago

The error SSLCertVerificationError indicates that the SSL certificate verification failed due to a self-signed certificate in the certificate chain when trying to connect to api.domer.ai. This typically happens when the server's SSL certificate is not trusted by the client.

To resolve this, you can bypass SSL verification by setting verify=False in your requests. Here is an example of how to do this using the requests library:

import os
import requests
from pandasai import Agent

# Disable SSL warnings
requests.packages.urllib3.disable_warnings(requests.packages.urllib3.exceptions.InsecureRequestWarning)

# Set your API key
os.environ["PANDASAI_API_KEY"] = "YOUR_API_KEY"

# Create an Agent instance
agent = Agent("examples/data/Loan payments data.csv")

# Example of making a request with SSL verification disabled
response = requests.get('https://api.domer.ai', verify=False)

# Example #1: train the model with docs
agent.train(docs="Only return loans information about the past 10 years")

response = agent.chat("How many loans were paid off?")
print(response)

# Example #2: train the model with Q/A
query = "How many loans were paid off?"
code = """
import pandas as pd

df = dfs[0]
df['loan_status'].value_counts()
"""
agent.train(queries=[query], codes=[code])

response = agent.chat(query)
print(response)

Note: Disabling SSL verification is not recommended for production environments as it makes the connection insecure. It should only be used for testing purposes [1].

To continue talking to Dosu, mention @dosu.

rogerlpag commented 1 month ago

Is using agent.train() method require the docker

From: dosubot[bot] @.> Sent: Monday, August 5, 2024 2:58 PM To: Sinaptik-AI/pandas-ai @.> Cc: Roger Leung @.>; Author @.> Subject: Re: [Sinaptik-AI/pandas-ai] Is that a must to use the Docker component if I am using the agent function? (Issue #1310)

EXTERNAL

The error SSLCertVerificationError indicates that the SSL certificate verification failed due to a self-signed certificate in the certificate chain when trying to connect to api.domer.ai. This typically happens when the server's SSL certificate is not trusted by the client.

To resolve this, you can bypass SSL verification by setting verify=False in your requests. Here is an example of how to do this using the requests library:

import os

import requests

from pandasai import Agent

Disable SSL warnings

requests.packages.urllib3.disable_warnings(requests.packages.urllib3.exceptions.InsecureRequestWarning)

Set your API key

os.environ["PANDASAI_API_KEY"] = "YOUR_API_KEY"

Create an Agent instance

agent = Agent("examples/data/Loan payments data.csv")

Example of making a request with SSL verification disabled

response = requests.get('https://api.domer.ai', verify=False)

Example #1: train the model with docs

agent.train(docs="Only return loans information about the past 10 years")

response = agent.chat("How many loans were paid off?")

print(response)

Example #2: train the model with Q/A

query = "How many loans were paid off?"

code = """

import pandas as pd

df = dfs[0]

df['loan_status'].value_counts()

"""

agent.train(queries=[query], codes=[code])

response = agent.chat(query)

print(response)

Note: Disabling SSL verification is not recommended for production environments as it makes the connection insecure. It should only be used for testing purposes [1]https://github.com/Sinaptik-AI/pandas-ai/blob/main/examples/using_train.py.

To continue talking to Dosuhttps://dosu.dev/, mention @dosuhttps://github.com/dosu.

- Reply to this email directly, view it on GitHubhttps://github.com/Sinaptik-AI/pandas-ai/issues/1310#issuecomment-2268315172, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BD2EHIH4KMENSIMPGATW7JDZP4O7PAVCNFSM6AAAAABL7UYLBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRYGMYTKMJXGI. You are receiving this because you authored the thread.Message ID: @.***>


The information contained in this email (including all attached files) is confidential and may be legally privileged. If you are not the intended recipient, you may not disclose or use the information in this email in any way. If you have received this email in error, please notify us immediately by return e-mail and delete the email and all attachments from your system. Please follow the attached URL to an important disclosure regarding our firm's privacy policy: https://www.pag.com/en/privacy-policy Thank you.

dosubot[bot] commented 1 month ago

No, using the agent.train() method in the pandas-ai library does not require Docker. You can use the agent.train() method directly in a Python script without any mention of Docker [1].

To continue talking to Dosu, mention @dosu.