Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not implemented error while using langchain llm.with_structured_output() with gemini-pro model. #214

Open
thenaivekid opened this issue May 8, 2024 · 0 comments

Comments

@thenaivekid
Copy link

NotImplementedError Traceback (most recent call last)
Cell In[8], line 21
18 # LLM with function call
19 # llm = ChatOpenAI(model="gpt-3.5-turbo-0125", temperature=0)
20 llm = GoogleGenerativeAI(model="gemini-pro", temperature=0.7)
---> 21 structured_llm_grader = llm.with_structured_output(GradeDocuments)
23 # Prompt
24 system = """You are a grader assessing relevance of a retrieved document to a user question. \n
25 If the document contains keyword(s) or semantic meaning related to the question, grade it as relevant. \n
26 Give a binary score 'yes' or 'no' score to indicate whether the document is relevant to the question."""

File c:\Users\Acer\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain_core\language_models\base.py:208, in BaseLanguageModel.with_structured_output(self, schema, **kwargs)
204 def with_structured_output(
205 self, schema: Union[Dict, Type[BaseModel]], **kwargs: Any
206 ) -> Runnable[LanguageModelInput, Union[Dict, BaseModel]]:
207 """Implement this if there is a way of steering the model to generate responses that match a given schema.""" # noqa: E501
--> 208 raise NotImplementedError()

NotImplementedError:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant