Sydney Runkle and GitHub
19ca6b416b
fix: post_model_hook should inject state + store into tool calls if necessary ( #4842 )
2025-05-27 17:42:20 +00:00
Sydney Runkle and GitHub
7bd8616b1e
feature: Implement post_model_hook and HumanInterruptNode ( #4583 )
2025-05-19 14:07:42 -04:00
Sydney Runkle and GitHub
228a08b966
ci: migrate to uv! ( #4698 )
...
* Migrate to `uv`
* Format `pyproject.toml` files properly
* Remove upper bounds on dependencies, and bounds on dev dependencies
(we should be using latest)
* Move to hatch for packaing
In the future we should:
* Set up dependabot / automate lockfile updates and tests
* Add tests for min compatible versions (I'll do this right after merge)
* Use dynamic versioning
* Bump `pydantic` to v2.11.4 in the lockfile, we have some tests failing
2025-05-15 17:39:14 -07:00
Nuno Campos and GitHub
909a4591a8
Port checkpointer/store fixtures in langgraph-prebuilt to idiomatic pattern ( #4629 )
2025-05-09 19:42:44 +00:00
Vadym Barda and GitHub
0e61cc2cf6
prebuilt: remove state_modifier ( #4439 )
...
Removes support for `state_modifier` param in `create_react_agent`. To
specify system prompt / instructions use `prompt` parameter.
2025-05-05 09:49:28 -04:00
vbarda
4b7ec256e9
prebuilt: switch to executing parallel tool calls via Send by default
2025-04-28 11:07:27 -04:00
Sydney Runkle
9e89b68596
fixing prebuilt tests
2025-04-22 17:24:54 -07:00
Vadym Barda and GitHub
67e8f8fc11
prebuilt: add optional pre-model hook that runs before calling LLM in create_react_agent ( #4059 )
...
Example:
```python
from typing import Any
from langchain_openai import ChatOpenAI
from langchain_community.tools.tavily_search import TavilySearchResults
from langchain_core.messages import AnyMessage
from langchain_core.messages.utils import count_tokens_approximately
from langgraph.graph import MessagesState
from langgraph.prebuilt.chat_agent_executor import create_react_agent, AgentState
from langgraph.checkpoint.memory import InMemorySaver
from langmem.short_term import SummarizationNode, RunningSummary
class State(MessagesState):
context: dict[str, Any]
search = TavilySearchResults(max_results=3)
tools = [search]
model = ChatOpenAI(model="gpt-4o")
summarization_model = model.bind(max_tokens=256)
summarization_node = SummarizationNode(
token_counter=count_tokens_approximately,
model=summarization_model,
max_tokens=2048,
max_summary_tokens=256,
output_messages_key="messages"
# output_messages_key="llm_input_messages"
)
checkpointer = InMemorySaver()
class State(AgentState):
user_language: str
# summarization-related keys
context: dict[str, Any]
def prompt(state):
language = state["user_language"]
system_msg = f"Always respond in {language}"
return [{"role": "system", "content": system_msg}] + state["messages"]
graph = create_react_agent(
model,
tools,
prompt=prompt,
pre_model_hook=summarization_node,
state_schema=State,
checkpointer=checkpointer
)
```
2025-04-02 15:41:31 +00:00
Nuno Campos
49bb08a3f9
Update prebuilt test
2025-03-27 17:58:29 -07:00
3183146141
prebuilt: allow pydantic model as state schema in create_react_agent ( #3559 )
...
Inherited attributes where not considered.
Pydantic model can inherit from other pydantic models. In those cases,
inherited attributes where not considered in the check and the code
fails.
---------
Co-authored-by: vbarda <vadym@langchain.dev >
2025-03-07 16:49:51 -05:00
Vadym Barda and GitHub
e8dd682320
prebuilt: allow passing RunnableSequence as a model ( #3706 )
2025-03-06 02:37:55 +00:00
Vadym Barda and GitHub
24c13c211e
langgraph: separate prebuilt into a standalone package ( #3589 )
2025-02-26 18:33:07 -05:00