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

Bump langchain-openai from 0.2.14 to 0.3.1 #4766

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

Conversation

dependabot[bot]
Copy link
Contributor

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

Bumps langchain-openai from 0.2.14 to 0.3.1.

Release notes

Sourced from langchain-openai's releases.

langchain-openai==0.3.1

Changes since langchain-openai==0.3.0

openai[patch]: fix Azure LLM test (#29302) openai[patch]: release 0.3.1 (#29301) anthropic[patch]: support parallel_tool_calls (#29257) docs: oai api ref nit (#29210) openai: disable streaming for o1 by default (#29147) docs: Update openai README.md (#29146)

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

Dependabot compatibility score

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)

@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Jan 20, 2025
Bumps [langchain-openai](https://github.com/langchain-ai/langchain) from 0.2.14 to 0.3.1.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](langchain-ai/langchain@langchain-openai==0.2.14...langchain-openai==0.3.1)

---
updated-dependencies:
- dependency-name: langchain-openai
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/pip/langchain-openai-0.3.1 branch from 67a2d32 to 63908b9 Compare January 23, 2025 16:15
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