langchain-coder icon indicating copy to clipboard operation
langchain-coder copied to clipboard

litellm missing on streamlit cloud site

Open balgad opened this issue 1 year ago • 11 comments
trafficstars

I tried to enter OpenAI API key via the streamlit cloud site (https://langchain-coder.streamlit.app/) but got an error message after pushing enter: "Error loading Open AI: Could not import litellm python package. Please install it with `pip install"

image

Could you fix this?

Thank you

balgad avatar Mar 04 '24 17:03 balgad

Okay thanks i will take a look at this issue.

haseeb-heaven avatar Mar 04 '24 19:03 haseeb-heaven

Okay i have fixed this issue please check

haseeb-heaven avatar Mar 04 '24 20:03 haseeb-heaven

It's working now, many thanks!

balgad avatar Mar 04 '24 21:03 balgad

Found another issue:

  • after setting up OpenAI with API key
  • chose online compiler and accepted privacy policy
  • chose different models for chatgpt
  • gave an input to coder ("task='write python code using plotly express to draw histograms from a dataframe which has two categorical columns ("a" and "b") and one numerical ("c"). need as many histograms as the number of categorical columns.'") - pressed control+enter after the input
  • got an error message after had pushed "execute" button: "Compilation language must not be null"

image

balgad avatar Mar 04 '24 21:03 balgad

Can you send me the logs of this file and Download them from Settings.

haseeb-heaven avatar Mar 04 '24 22:03 haseeb-heaven

Of course, I attach it (now I faced with another issue, seems to have some connection problem, too) langchain-coder (2).log

(anyway, it's a great app! :) )

balgad avatar Mar 05 '24 12:03 balgad

Of course, I attach it (now I faced with another issue, seems to have some connection problem, too) langchain-coder (2).log

(anyway, it's a great app! :) )

Thanks for trying i checked the logs, it seems like you used GPT-3 model, can you try with other GPT Models and see if same error exist.

And yes its great project but Google gemini Advanced has Code Generator and Editor IDE as well so thats what most people will use not.

haseeb-heaven avatar Mar 05 '24 13:03 haseeb-heaven

Thanks for your answers.

I checked but something is not okay with online compiler, I attach the log file. After entering all inputs and pushing Generate button an error message appears on seems to be nothing happens because no output at all with online compiler. If I switch to offline compiler the generated code shows up correctly in a lot of cases, but changing back to online seems nothing happens (according to log file I didn't accept policy - but I did it).

Anyway, in EU a lot of employer disable generative AI sites (this happens in my case, too), so quite hard to use them. With your app we got a very good opportunity to use them (and app simplifies generating too in comparison with general prompting).

langchain-coder (16).log

balgad avatar Mar 05 '24 15:03 balgad

image

I generated the diagram using my other project Code-Interpreter,

Here is the code:

image

The coding Langchain uses online compilers which are limited they dont have all the external libraries installed so you need them and its very expensive for me to have servers with lots of space for external libraries so thats only the downside of this product.

I checked the online compiler acting weirdly not setting the language i will try to fix this asap.

haseeb-heaven avatar Mar 05 '24 19:03 haseeb-heaven

Thank you for your explanation and help.

Code-interpreter is very promising :) I will try it, it's very likable.

balgad avatar Mar 05 '24 19:03 balgad

Thank you for your explanation and help.

Code-interpreter is very promising :) I will try it, it's very likable.

Yes Code Interpreter is Python interpreter so any task for Python related which needs external libraries are best suited like Data-analysis and Graphs/Charts generation locally using all LLMs OpenAI,Gemini,Claude and more.

haseeb-heaven avatar Mar 05 '24 20:03 haseeb-heaven