microsoft / lida

Automatic Generation of Visualizations and Infographics using Large Language Models
https://microsoft.github.io/lida/
MIT License
2.57k stars 260 forks source link

TypeError: got an unexpected keyword argument 'azure_endpoint' #97

Closed ghost closed 4 months ago

ghost commented 4 months ago

I'm using this code and getting this error

code:

from dotenv import load_dotenv from lida import Manager, llm import os

load_dotenv()

text_gen = llm( provider="openai", api_type="azure", azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"], api_key=os.environ["AZURE_OPENAI_API_KEY"], api_version="2023-07-01-preview", ) lida = Manager(text_gen=text_gen)

print(lida)

Error:

Traceback (most recent call last): File "C:\FastAPI Projects\RAG.api\test.py", line 8, in text_gen = llm( ^^^^ File "C:\FastAPI Projects\RAG.api\venv\Lib\site-packages\llmx\generators\text\textgen.py", line 52, in llm return OpenAITextGenerator(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: OpenAITextGenerator.init() got an unexpected keyword argument 'azure_endpoint'

victordibia commented 4 months ago

try updating library version.

pip install -U llmx lida openai
ghost commented 4 months ago

working now, these libraries aren't mentioned in the notebook where all the implementation is written down, thanks :)