ag-ui-protocol / ag-ui-protocol/ag-ui

[Feature]: (LangGraph) Pass `durability` to `.astream_values`

Đang mở
#1,703 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Python
Star
15.9k
Fork
1.4k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
163

Mô tả

### Pre-flight Checklist

- [x] I have searched existing issues and this hasn't been requested yet.

### Problem or Motivation

### What

Pass [durability](https://docs.langchain.com/oss/python/langgraph/durable-execution#durability-modes) to `astream_events` [here](https://github.com/ag-ui-protocol/ag-ui/blob/main/integrations/langgraph/python/ag_ui_langgraph/agent.py#L552):
```python
kwargs["durability"] = "" # add somehow
stream = self.graph.astream_events(**kwargs)
```

### Why

I think durability [defaults to](https://github.com/langchain-ai/langgraph/blob/076e2a3627206f5a1aef573aaca4a01e5af897ca/libs/langgraph/langgraph/pregel/main.py#L2676) `durability="async"` in LangGraph, which implies a lot of extra DB reads/write compared to`"exit"`.

I think it's useful to be able to control it as a lot of high traffic use cases will want to use `exit`.

### Proposed Solution

Not sure what is the best way to pass durability. I think there is no need to pass it at invocation, and could be set as an env var `AG_UI_LANGGRAPH_DURABILITY`.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.