You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ValidationError: 1 validation error for OpenAI root
ConnectionPool.init() got an unexpected keyword argument 'socket_options' (type=type_error)
The code snippet looks like
import os
from dotenv import load_dotenv
import openai
from langchain import OpenAI,ConversationChain, LLMChain, PromptTemplate
load_dotenv()
openai_api_key = os.getenv('OPENAI_API_KEY')
llm=OpenAI(api_key=openai_api_key)
ValidationError: 1 validation error for OpenAI
root
ConnectionPool.init() got an unexpected keyword argument 'socket_options' (type=type_error)
The code snippet looks like
import os
from dotenv import load_dotenv
import openai
from langchain import OpenAI,ConversationChain, LLMChain, PromptTemplate
load_dotenv()
openai_api_key = os.getenv('OPENAI_API_KEY')
llm=OpenAI(api_key=openai_api_key)
The exact stack of error is:
ValidationError Traceback (most recent call last)
Cell In[16], line 1
----> 1 llm=OpenAI(api_key=openai_api_key)
File c:\Users\Charanjeet Juneja\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain_core_api\deprecation.py:171, in deprecated..deprecate..finalize..warn_if_direct_instance(self, *args, **kwargs)
169 warned = True
170 emit_warning()
--> 171 return wrapped(self, *args, **kwargs)
File c:\Users\Charanjeet Juneja\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain_core\load\serializable.py:107, in Serializable.init(self, **kwargs)
106 def init(self, **kwargs: Any) -> None:
--> 107 super().init(**kwargs)
108 self._lc_kwargs = kwargs
File c:\Users\Charanjeet Juneja\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydantic\v1\main.py:341, in BaseModel.init(pydantic_self, **data)
339 values, fields_set, validation_error = validate_model(pydantic_self.class, data)
340 if validation_error:
--> 341 raise validation_error
342 try:
343 object_setattr(pydantic_self, 'dict', values)
ValidationError: 1 validation error for OpenAI
root
ConnectionPool.init() got an unexpected keyword argument 'socket_options' (type=type_error)
The text was updated successfully, but these errors were encountered: