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

Update langchain-openai requirement from <0.3 to <0.4 in /topic/machine-learning/llm-langchain #800

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 13, 2025

Updates the requirements on langchain-openai to permit the latest version.

Release notes

Sourced from langchain-openai's releases.

langchain-openai==0.3.0

langchain-openai==0.3 implements two breaking changes:

Structured output

We update the default method parameter for ChatOpenAI(...).with_structured_output(method=<method>) from method="function_calling" to method="json_schema".

For schemas specified via TypedDict or JSON schema, strict schema validation is disabled by default but can be enabled by specifying strict=True.

Note: conceptually there is a difference between forcing a tool call and forcing a response format. Tool calls may have more concise arguments versus generating content adhering to a schema. Prompts may need to be adjusted to recover desired behavior.

How to retain the 0.2 with_structured_output behavior after upgrading to 0.3

To change this behavior back, you can pass method="function_calling" to your with_structured_output calls that you want to switch the behavior back.

Expected errors

  1. Models that don’t support method="json_schema" (e.g., gpt-4 and gpt-3.5-turbo, currently the default model for ChatOpenAI) will raise an error unless method is explicitly specified. To recover the previous default, pass method="function_calling" into with_structured_output.

  2. Schemas specified via Pydantic BaseModel that have fields with non-null defaults or metadata (like min/max constraints) will raise an error. To recover the previous default, pass method="function_calling" into with_structured_output. See OpenAI's docs for supported schemas.

Optional parameters

We no longer implement non-null defaults for temperature, max_retires, and n, which are optional fields. In particular, we no longer specify a default temperature of 0.7.

The previous defaults can be set by specifying:

  • temperature=0.7
  • max_retries=2
  • n=1
Commits
  • 6e63ccb openai[minor]: release 0.3 (#29100)
  • facfd42 docs[patch]: fix links in partner package table (#29112)
  • 815bfa1 openai[patch]: support streaming with json_schema response format (#29044)
  • 858f655 docs: add Docling loader docs (#29104)
  • cc55e32 docs: Adding voyage-3-large to the .ipynb file (#29098)
  • 287abd9 Update word in databricks_vector_search.ipynb from "cna" to "can" (#29109)
  • a46c2bc [Community]: Small Fix in google_firestore memory notebook (#29107)
  • 00dcc44 Langchain_community: Fix issue with missing backticks in arango client (#29110)
  • fa6f08f docs: Add upstage document parse loader to pdf loaders (#29099)
  • 2b09f79 community: add init for UnstructuredHTMLLoader to solve pathlib paths (#29091)
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [langchain-openai](https://github.com/langchain-ai/langchain) to permit the latest version.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](langchain-ai/langchain@langchain-openai==0.1.5...langchain-openai==0.3.0)

---
updated-dependencies:
- dependency-name: langchain-openai
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants