Skip to content

fix(deps): update the langchain-core dependency - #38

Merged
daveomri merged 3 commits into
feat/modernize-langchain-integrationfrom
feat/release-a-version-compatible-with-langchain-1.x
Jul 9, 2026
Merged

daveomri merged 3 commits into
feat/modernize-langchain-integrationfrom
feat/release-a-version-compatible-with-langchain-1.x

Conversation

@daveomri

@daveomri daveomri commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Bump langchain-core to support LangChain 1.x

Widens the core pin so the connector installs alongside LangChain 1.x while staying compatible with 0.3.x. Connector source is unchanged; it only uses stable APIs (BaseTool, Document, BaseRetriever, BaseLoader, ArgsSchema, ToolException).

- langchain-core = "^0.3.15"          # >=0.3.15,<0.4.0
+ langchain-core = ">=0.3.15,<2.0.0"  # 0.3.x AND 1.x

Fixes #37 (@vdusek, @MQ37): the old <0.4 pin makes pip install "langchain>=1.0.0" langchain-apify unresolvable, blocking any 1.x project.

Testing

  • 410/410 unit tests pass on langchain-core 1.4.8.
  • pip install "langchain>=1.0.0" langchain-apify now resolves (was ResolutionImpossible).
  • All doc snippets verified green on both 0.3.x and 1.x (live Apify platform + local model).

🟡 Decision: dual-support now, defer full 1.x

This PR keeps dual support (0.3.x + 1.x) and defers the full 1.x migration to a later PR. Rationale: a full 1.x move touches the agent API and dev-deps, which would reopen the already-reviewed feat/modernize-langchain-integration work. Widening the pin unblocks #37 without that churn.

The one snag, for later: there is no agent import clean on both versions.

Option 0.3.x 1.x Note
Keep create_react_agent (this PR) ⚠️ deprecated (warns) widest support, defers the choice
Go create_agent (future, 1.x-only) ✅ recommended matches upstream, drops 0.3.x

Docs stay on create_react_agent (works on both; only warns on 1.x). When the team decides to go fully 1.x, that becomes a focused follow-up: pin core ^1.0, bump dev-deps to ^1.0, re-lock, flip snippets to create_agent.

poetry.lock

Regenerated (poetry lock, Poetry 2.x). With current dev-deps it stays on core 0.3.80 — expected: langchain-openai ^0.3.2 and langchain-tests ^0.3.5 are dev/test-only and cap core <0.4. They do not constrain end users; 1.x runtime compat is proven by the 410 tests. One lock = one resolution, so testing both versions needs a CI matrix (follow-up).

Downstream docs (prepped + verified, land separately)

  • apify/apify-docs #2683: langchain.md
  • langchain-ai/docs: 7 provider .mdx pages + examples/tools_example.py

Version-agnostic (done, needed either way):

  • Removed APIs (VectorstoreIndexCreator, query_with_sources) → retriever + ChatPromptTemplate chain (langchain.md, apify_dataset.mdx)
  • apify.mdx: instantiate tool-list classes; call_actor uses startUrls; MCP uses client = MultiServerMCPClient(...) + transport: "streamable_http"; ApifyActorsTool prose fix
  • Agent chaining imports → langchain_core.messages + create_react_agent (apify_actors.mdx, apify_web_crawler.mdx, apify_google_search.mdx)
  • Model name normalized to gpt-5-mini everywhere
  • No change: apify_crawl.mdx

Decision-dependent (only if full 1.x): flip agent snippets to langchain.agents.create_agent and add the langchain meta to those install lines.

Follow-ups (separate PRs, non-blocking)

  • Full 1.x migration (the deferred decision above): pin core ^1.0, bump dev-deps to ^1.0, re-lock, flip agent snippets to create_agent.
  • Bump apify-client to ^2.5.0, replace raw requests build-fetch with SDK default_build().
  • Migrate examples/tools_example.py to the LangGraph/LangChain 1.0 agent API.
  • CI matrix to exercise both 0.3.x and 1.x resolutions.

@daveomri
daveomri requested review from MQ37 and jirispilka July 8, 2026 14:02
@daveomri daveomri self-assigned this Jul 8, 2026

@vdusek vdusek left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment regarding the other deps.

And the same applies to apify-client. With this constraint setup, it won't be possible to install this package together with the new major version of the SDK.

The best practice is to use an upper-bound constraint only when you know there is an incompatibility. This applies to libraries only, of course.

Comment thread pyproject.toml Outdated

@jirispilka jirispilka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine but I'll leave the review to Kuba and Vlada

Comment thread pyproject.toml Outdated

@MQ37 MQ37 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

I would keep the backwards compatible create_react_agent for now and we can do breaking update in future.

@vdusek vdusek left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Also, if you generate the changelog from the PR titles, I'd use "fix(deps): ...".

@daveomri daveomri changed the title chore: update the langchain-core dependency fix(deps): update the langchain-core dependency Jul 9, 2026
@daveomri
daveomri merged commit 4d268da into feat/modernize-langchain-integration Jul 9, 2026
6 checks passed
@daveomri
daveomri deleted the feat/release-a-version-compatible-with-langchain-1.x branch July 9, 2026 10:11
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

Successfully merging this pull request may close these issues.

5 participants