Comments (3)
Imported the wrong OpenAI, fixed ✅
from pandas-ai.
May I know how you solve the issue? Which OpenAI is correct?
from pandas-ai.
Import the OpenAI instance from the pandas LLM library:
import os
import pandas as pd
from pandasai import Agent, SmartDataframe
from pandasai.llm import OpenAI
Then pass it in to your Smart DataFrame as a config param:
os.environ["PANDASAI_API_KEY"] = os.environ.get("PANDASAI_API_KEY")
llm = OpenAI(api_token=os.environ.get("OPENAI_API_KEY"))
df = pd.DataFrame(self.__dataset)
pAI = SmartDataframe(df, config={"verbose": True, "llm": llm})
And Chat !
llm_analysis_response = pAI.chat("Your query here")
There are probably other ways to go around it, but this is how I've done it.
from pandas-ai.
Related Issues (20)
- Support Open WebUI API
- DIsplay japanese characters in the plot image HOT 1
- when i note "direct_sql": True, error:Not an executable object: "\nSELECT \n ELECTRY_NAME,\n ...... HOT 2
- why so slow. compare langchaindatabase and vanna .... HOT 2
- Issue: pandasAI Authentication Error with OpenAI HOT 2
- Issue on docs HOT 1
- bug on output_type_template.tmpl HOT 2
- Not getting he correct answer
- There is a code error in the document HOT 1
- Unable to pass field_description for Smartdatalakes
- pip install pandasai fails on Windows HOT 3
- Pandasai ordering custom order not correct HOT 3
- Unable to save chart image, or setting not to save chart will throw error "No such file or directory" HOT 3
- Analisis
- Return incorrect result for incorrect input HOT 2
- Unnecessary datatype mismatch error | Pandas AI HOT 2
- docker-compose up fails HOT 1
- Unable to contribute due to aiohttp package HOT 1
- Last code generated never used for prompt generation HOT 1
- Metrics and Metadata for each request
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandas-ai.