Patrefans
echohive42 from patreon
echohive42 patreon

Langchain Async explained. Make multiple OpenAI chatgpt API calls at the same time video files

🕑 Added 2023-03-06 01:07:30 +0000 UTC

Comments

Echo Hive

Thank you for letting me know. I was thinking of going over old projects when I find some time. Maybe I will make live streams while updating the code

vesper8

I've tried to replace llm = OpenAIChat(temperature=0.9) with llm = ChatOpenAI(temperature=0.9, model_name="gpt-3.5-turbo", openai_api_key=os.getenv('OPENAI_API_KEY')) After adding from langchain.chat_models import ChatOpenAI I also confirmed my API key is read correctly. But it seems it's not that simple. Now I'm getting File "/opt/homebrew/lib/python3.10/site-packages/langchain/chat_models/base.py", line 119, in agenerate results = await asyncio.gather( File "/opt/homebrew/lib/python3.10/site-packages/langchain/chat_models/openai.py", line 359, in _agenerate message_dicts, params = self._create_message_dicts(messages, stop) File "/opt/homebrew/lib/python3.10/site-packages/langchain/chat_models/openai.py", line 341, in _create_message_dicts message_dicts = [_convert_message_to_dict(m) for m in messages] File "/opt/homebrew/lib/python3.10/site-packages/langchain/chat_models/openai.py", line 341, in message_dicts = [_convert_message_to_dict(m) for m in messages] File "/opt/homebrew/lib/python3.10/site-packages/langchain/chat_models/openai.py", line 117, in _convert_message_to_dict raise ValueError(f"Got unknown type {message}") ValueError: Got unknown type T

vesper8

Also getting this warning when running llm.py with instructions. Not sure if you'd want to update the scripts. It's still working though UserWarning: You are trying to use a chat model. This way of initializing it is no longer supported. Instead, please use: `from langchain.chat_models import ChatOpenAI`

Echo Hive

Thanks for letting me know. I will try to find the new ones and update the links

vesper8

Just want to point out that the three readthedocs.io links are now 404s


More Creators