Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/afraid-paws-give.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/angry-ads-retire.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/green-squids-fetch.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/honest-hats-brush.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/metal-camels-join.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/real-dogs-listen.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/silver-dingos-wonder.md

This file was deleted.

142 changes: 142 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Configuration for GitHub Actions Labeler
# https://github.com/actions/labeler

internal:
- changed-files:
- any-glob-to-any-file:
- internal/**
- internal/**/*

ci:
- changed-files:
- any-glob-to-any-file:
- .github/workflows/**
- .github/actions/**
- dependency_range_tests/**
- dependency_range_tests/**/*
- environment_tests/**
- environment_tests/**/*
- libs/langchain-scripts/**
- libs/langchain-scripts/**/*
- libs/langchain-standard-tests/**
- libs/langchain-standard-tests/**/*

examples:
- changed-files:
- any-glob-to-any-file:
- examples/**
- examples/**/*

langchain:
- changed-files:
- any-glob-to-any-file:
- langchain/**
- langchain/**/*

core:
- changed-flies:
- any-glob-to-any-file:
- langchain-core/**
- langchain-core/**/*

textsplitters:
- changed-files:
- any-glob-to-any-file:
- libs/langchain-textsplitters/**
- libs/langchain-textsplitters/**/*

provider/anthropic:
- changed-files:
- any-glob-to-any-file:
- libs/langchain-anthropic/**
- libs/langchain-anthropic/**/*

provider/aws:
- changed-files:
- any-glob-to-any-file:
- libs/langchain-aws/**
- libs/langchain-aws/**/*

provider/azure:
- changed-files:
- any-glob-to-any-file:
- libs/langchain-*azure*/**
- libs/langchain-*azure*/**/*

provider/ollama:
- changed-files:
- any-glob-to-any-file:
- libs/langchain-ollama/**
- libs/langchain-ollama/**/*

provider/openai:
- changed-files:
- any-glob-to-any-file:
- libs/langchain-openai/**
- libs/langchain-openai/**/*

provider/google:
- changed-files:
- any-glob-to-any-file:
- libs/langchain-*google*/**
- libs/langchain-*google*/**/*

provider/groq:
- changed-files:
- any-glob-to-any-file:
- libs/langchain-groq/**
- libs/langchain-groq/**/*

provider/mistralai:
- changed-files:
- any-glob-to-any-file:
- libs/langchain-mistralai/**
- libs/langchain-mistralai/**/*

provider/mongodb:
- changed-files:
- any-glob-to-any-file:
- libs/langchain-mongodb/**
- libs/langchain-mongodb/**/*

provider/redis:
- changed-files:
- any-glob-to-any-file:
- libs/langchain-redis/**
- libs/langchain-redis/**/*

provider/xai:
- changed-files:
- any-glob-to-any-file:
- libs/langchain-xai/**
- libs/langchain-xai/**/*

community:
- changed-files:
- any-glob-to-any-file:
- libs/langchain-community/**
- libs/langchain-community/**/*
- libs/langchain-baidu-qianfan/**
- libs/langchain-baidu-qianfan/**/*
- libs/langchain-cerebras/**
- libs/langchain-cerebras/**/*
- libs/langchain-cloudflare/**
- libs/langchain-cloudflare/**/*
- libs/langchain-cohere/**
- libs/langchain-cohere/**/*
- libs/langchain-exa/**
- libs/langchain-exa/**/*
- libs/langchain-mixedbread-ai/**
- libs/langchain-mixedbread-ai/**/*
- libs/langchain-nomic/**
- libs/langchain-nomic/**/*
- libs/langchain-pinecone/**
- libs/langchain-pinecone/**/*
- libs/langchain-qdrant/**
- libs/langchain-qdrant/**/*
- libs/langchain-tavily/**
- libs/langchain-tavily/**/*
- libs/langchain-weaviate/**
- libs/langchain-weaviate/**/*
- libs/langchain-yandex/**
- libs/langchain-yandex/**/*
20 changes: 20 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Automatically label PRs based on the files changed
name: "Pull Request Labeler"

on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
pull-requests: write

jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Label PR based on file paths
uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true # Remove labels when files no longer match
7 changes: 7 additions & 0 deletions langchain-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @langchain/core

## 0.3.78

### Patch Changes

- 1519a97: update chunk concat logic to match on missing ID fields
- 079e11d: omit tool call chunks without tool call id

## 0.3.76

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion langchain-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@langchain/core",
"version": "0.3.77",
"version": "0.3.78",
"description": "Core LangChain.js abstractions and schemas",
"type": "module",
"engines": {
Expand Down
10 changes: 10 additions & 0 deletions langchain/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# langchain

## 0.3.35

### Patch Changes

- fd4691f: use `keyEncoder` instead of insecure cache key getter
- 2f19cd5: feat: Add Perplexity support to universal chat model
- 3c94076: fix(langchain): Bind schemas for other types of pulled hub prompts
- Updated dependencies [d38e9d6]
- @langchain/openai@0.6.14

## 0.3.34

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion langchain/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "langchain",
"version": "0.3.34",
"version": "0.3.35",
"description": "Typescript bindings for langchain",
"type": "module",
"engines": {
Expand Down
8 changes: 8 additions & 0 deletions libs/langchain-anthropic/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @langchain/anthropic

## 0.3.29

### Patch Changes

- 93493ee: add support for context management
- 93493ee: add support for memory server tools
- 93493ee: add default init options for sonnet-4.5

## 0.3.28

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions libs/langchain-anthropic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@langchain/anthropic",
"version": "0.3.28",
"version": "0.3.29",
"description": "Anthropic integrations for LangChain.js",
"type": "module",
"engines": {
Expand Down Expand Up @@ -35,7 +35,7 @@
"author": "LangChain",
"license": "MIT",
"dependencies": {
"@anthropic-ai/sdk": "^0.56.0",
"@anthropic-ai/sdk": "^0.65.0",
"fast-xml-parser": "^4.4.1"
},
"peerDependencies": {
Expand Down
40 changes: 26 additions & 14 deletions libs/langchain-anthropic/src/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
} from "./utils/message_outputs.js";
import {
AnthropicBuiltInToolUnion,
AnthropicContextManagementConfigParam,
AnthropicMessageCreateParams,
AnthropicMessageStreamEvent,
AnthropicRequestOptions,
Expand Down Expand Up @@ -83,7 +84,7 @@ function _documentsInParams(
block != null &&
block.type === "document" &&
typeof block.citations === "object" &&
block.citations.enabled
block.citations?.enabled
) {
return true;
}
Expand All @@ -104,22 +105,25 @@ function isAnthropicTool(tool: any): tool is Anthropic.Messages.Tool {
}

function isBuiltinTool(tool: unknown): tool is AnthropicBuiltInToolUnion {
const builtinTools = [
"web_search",
"bash",
"code_execution",
"computer",
"str_replace_editor",
"str_replace_based_edit_tool",
const builtInToolPrefixes = [
"text_editor_",
"computer_",
"bash_",
"web_search_",
"web_fetch_",
"str_replace_editor_",
"str_replace_based_edit_tool_",
"code_execution_",
"memory_",
];
return (
typeof tool === "object" &&
tool !== null &&
"type" in tool &&
"name" in tool &&
typeof tool.type === "string" &&
typeof tool.name === "string" &&
builtinTools.includes(tool.name)
builtInToolPrefixes.some(
(prefix) => typeof tool.type === "string" && tool.type.startsWith(prefix)
)
);
}

Expand Down Expand Up @@ -160,7 +164,7 @@ export interface AnthropicInput {
* To not set this field, pass `null`. If `undefined` is passed,
* the default (-1) will be used.
*
* For Opus 4.1, this defaults to `null`.
* For Opus 4.1 and Sonnet 4.5, this defaults to `null`.
*/
topP?: number | null;

Expand Down Expand Up @@ -222,6 +226,11 @@ export interface AnthropicInput {
* Options for extended thinking.
*/
thinking?: AnthropicThinkingConfigParam;

/**
* Configuration for context management. See https://docs.claude.com/en/docs/build-with-claude/context-editing
*/
contextManagement?: AnthropicContextManagementConfigParam;
}

/**
Expand Down Expand Up @@ -681,6 +690,8 @@ export class ChatAnthropicMessages<

thinking: AnthropicThinkingConfigParam = { type: "disabled" };

contextManagement?: AnthropicContextManagementConfigParam;

// Used for non-streaming requests
protected batchClient: Anthropic;

Expand Down Expand Up @@ -720,8 +731,8 @@ export class ChatAnthropicMessages<

this.invocationKwargs = fields?.invocationKwargs ?? {};

if (this.model.includes("opus-4-1")) {
// Default to `undefined` for `topP` for Opus 4.1 models
// Default to `undefined` for `topP` for Opus 4.1 and Sonnet 4.5 models
if (this.model.includes("opus-4-1") || this.model.includes("sonnet-4-5")) {
this.topP = fields?.topP === null ? undefined : fields?.topP;
} else {
this.topP = fields?.topP ?? this.topP;
Expand Down Expand Up @@ -872,6 +883,7 @@ export class ChatAnthropicMessages<
tools: this.formatStructuredToolToAnthropic(options?.tools),
tool_choice,
thinking: this.thinking,
context_management: this.contextManagement,
...this.invocationKwargs,
};
}
Expand Down
Loading
Loading