Skip to content

Commit

Permalink
Updating Dict schema to reflect current state of langchain-core (lang…
Browse files Browse the repository at this point in the history
…chain-ai#311)

Co-authored-by: Leonid Kuligin <lkuligin@yandex.ru>
  • Loading branch information
2 people authored and eliasecchig committed Jun 23, 2024
1 parent 778313b commit a40003e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/vertexai/langchain_google_vertexai/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1533,15 +1533,15 @@ class AnswerWithJustification(BaseModel):
.. code-block:: python
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.utils.function_calling import convert_to_openai_tool
from langchain_core.utils.function_calling import convert_to_openai_function
from langchain_google_vertexai import ChatVertexAI
class AnswerWithJustification(BaseModel):
'''An answer to the user question along with justification for the answer.'''
answer: str
justification: str
dict_schema = convert_to_openai_tool(AnswerWithJustification)
dict_schema = convert_to_openai_function(AnswerWithJustification)
llm = ChatVertexAI(model_name="gemini-pro", temperature=0)
structured_llm = llm.with_structured_output(dict_schema)
Expand Down

0 comments on commit a40003e

Please sign in to comment.