[PR #489] [MERGED] Add support for passing Callable metadata filter to FewShotExamples managed value #1499

Closed
opened 2026-02-20 17:44:53 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraph/pull/489
Author: @andrewnguonly
Created: 5/17/2024
Status: Merged
Merged: 5/20/2024
Merged by: @nfcampos

Base: mainHead: few-shot-filter


📝 Commits (3)

  • 18addb5 Add support for passing Callable metadata filter to FewShotExamples managed value.
  • 09bae30 Add checkpoint config to checkpoint metadata?
  • f545471 Merge main branch.

📊 Changes

4 files changed (+103 additions, -22 deletions)

View changed files

📝 langgraph/managed/few_shot.py (+20 -4)
📝 langgraph/pregel/__init__.py (+8 -4)
📝 tests/test_pregel.py (+40 -7)
📝 tests/test_pregel_async.py (+35 -7)

📄 Description

Summary

Callable metadata filters are used for filtering on checkpoint metadata that is only known at runtime. For example, in OpenGPTs, an assistant_id (an instance of a graph), is only known after it is created. In this scenario, a developer should define a function that retrieves the assistant_id from the passed RunnableConfig.

Implementation

  1. Update FewShotExamples to support passing a Callable metadata filter.
  2. ???

Next Steps

  1. Update langgraph version in LangGraph API after this feature is merged and released.
  2. Update OpenGPTs, pass function to FewShotExamples for filtering checkpoint metadata by assistant_id.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langgraph/pull/489 **Author:** [@andrewnguonly](https://github.com/andrewnguonly) **Created:** 5/17/2024 **Status:** ✅ Merged **Merged:** 5/20/2024 **Merged by:** [@nfcampos](https://github.com/nfcampos) **Base:** `main` ← **Head:** `few-shot-filter` --- ### 📝 Commits (3) - [`18addb5`](https://github.com/langchain-ai/langgraph/commit/18addb52aa518347b397e8c77b8ed3441df18d52) Add support for passing Callable metadata filter to FewShotExamples managed value. - [`09bae30`](https://github.com/langchain-ai/langgraph/commit/09bae3022da2fd08b6b16c8d40a78ee8b5b2e1b2) Add checkpoint config to checkpoint metadata? - [`f545471`](https://github.com/langchain-ai/langgraph/commit/f5454715dfc4c982bb6e3c0f9890ae0645c4becc) Merge main branch. ### 📊 Changes **4 files changed** (+103 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `langgraph/managed/few_shot.py` (+20 -4) 📝 `langgraph/pregel/__init__.py` (+8 -4) 📝 `tests/test_pregel.py` (+40 -7) 📝 `tests/test_pregel_async.py` (+35 -7) </details> ### 📄 Description ### Summary `Callable` metadata filters are used for filtering on checkpoint metadata that is only known at runtime. For example, in OpenGPTs, an `assistant_id` (an instance of a graph), is only known after it is created. In this scenario, a developer should define a function that retrieves the `assistant_id` from the passed `RunnableConfig`. ### Implementation 1. Update `FewShotExamples` to support passing a `Callable` metadata filter. 1. ??? ### Next Steps 1. Update `langgraph` version in LangGraph API after this feature is merged and released. 1. Update OpenGPTs, pass function to `FewShotExamples` for filtering checkpoint metadata by `assistant_id`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-20 17:44:53 -05:00
yindo closed this issue 2026-02-20 17:44:53 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#1499