Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
db1c0b0
Implement DaprSession for distributed session management and update M…
filintod Oct 19, 2025
f17fe4f
revert minor doc change
filintod Oct 19, 2025
eefd150
Merge branch 'main' into add-dapr-session
filintod Oct 19, 2025
ffbb8ae
add missing consistency in get methods, tests, use constants for cons…
filintod Oct 19, 2025
0726985
use consistency constants in more places
filintod Oct 19, 2025
d3a558c
increase coverage to be above 95% limit. update docs, add a couple ed…
filintod Oct 20, 2025
7c3aef6
Merge branch 'main' into add-dapr-session
filintod Oct 20, 2025
ade9144
mention encrypted session support in dapr statestore
filintod Oct 20, 2025
23136fa
improve docs, following openai cookbook suggestions
filintod Oct 20, 2025
40a65dc
pros/cons
filintod Oct 20, 2025
1c99128
make consistency constants part of public interface again
filintod Oct 20, 2025
f7e4769
update example to make the devex better, added reference to env var t…
filintod Oct 20, 2025
5ea717e
minor doc update
filintod Oct 21, 2025
f2341d3
Merge branch 'main' into add-dapr-session
filintod Oct 21, 2025
881fd03
remove extra file push by mistake
filintod Oct 21, 2025
d278e7a
Merge branch 'main' into add-dapr-session
filintod Oct 21, 2025
8f34021
correct docstring constant name
filintod Oct 21, 2025
3270020
feedback
filintod Oct 21, 2025
528b6af
let's try simpler let's aggressive docker check
filintod Oct 21, 2025
f4519df
Merge branch 'main' into add-dapr-session
filintod Oct 21, 2025
af03519
incorporate feedback, also add new context manager for session to aut…
filintod Oct 21, 2025
b8881b7
Merge branch 'main' into add-dapr-session
filintod Oct 21, 2025
42c802c
make unit test a unit test (not trying to connect to dapr)
filintod Oct 21, 2025
b0fed87
Merge branch 'main' into add-dapr-session
filintod Oct 21, 2025
7d444c4
Merge branch 'main' into add-dapr-session
filintod Oct 22, 2025
fac26d0
make example experience better by setting up components and starting …
filintod Oct 22, 2025
078e7d1
Merge branch 'main' into add-dapr-session
filintod Oct 22, 2025
57e0e63
Merge branch 'main' into add-dapr-session
filintod Oct 24, 2025
d1b4720
Merge branch 'main' into add-dapr-session
filintod Oct 27, 2025
80fd3e9
Merge branch 'main' into add-dapr-session
filintod Oct 29, 2025
72dd9eb
tackled feedback:
filintod Oct 29, 2025
401a906
Merge branch 'main' into add-dapr-session
filintod Oct 29, 2025
3637804
Merge branch 'main' into add-dapr-session
filintod Nov 5, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use consistency constants in more places
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
  • Loading branch information
filintod committed Oct 19, 2025
commit 0726985aeb63a89fb669bf173a99bbee80724df3
8 changes: 5 additions & 3 deletions docs/sessions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,18 @@ from agents.extensions.memory import DaprSession
session = DaprSession.from_address(
"user_123",
state_store_name="statestore",
dapr_address="localhost:50001",
dapr_address="localhost:50001", # The default Dapr gRPC port is 50001 and can be omitted.
)

# Optional: configure TTL and consistency
from agents.extensions.memory import CONSISTENCY_STRONG

session = DaprSession.from_address(
"user_123",
state_store_name="statestore",
dapr_address="localhost:50001",
dapr_address="localhost:50001", # The default Dapr gRPC port is 50001 and can be omitted.
ttl=3600, # 1 hour
consistency="strong", # or "eventual"
consistency=CONSISTENCY_STRONG, # or CONSISTENCY_EVENTUAL
)
```

Expand Down
10 changes: 7 additions & 3 deletions tests/extensions/memory/test_dapr_redis_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
from testcontainers.redis import RedisContainer # type: ignore[import-untyped]

from agents import Agent, Runner, TResponseInputItem
from agents.extensions.memory.dapr_session import DaprSession
from agents.extensions.memory.dapr_session import (
CONSISTENCY_EVENTUAL,
CONSISTENCY_STRONG,
DaprSession,
)
from tests.fake_model import FakeModel
from tests.test_responses import get_text_message

Expand Down Expand Up @@ -380,15 +384,15 @@ async def test_dapr_consistency_levels(dapr_container, monkeypatch):
session_id="eventual_consistency_test",
state_store_name="statestore",
dapr_address=dapr_address,
consistency="eventual",
consistency=CONSISTENCY_EVENTUAL,
)

# Test strong consistency
session_strong = DaprSession.from_address(
session_id="strong_consistency_test",
state_store_name="statestore",
dapr_address=dapr_address,
consistency="strong",
consistency=CONSISTENCY_STRONG,
)

try:
Expand Down
10 changes: 7 additions & 3 deletions tests/extensions/memory/test_dapr_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
pytest.importorskip("dapr") # Skip tests if Dapr is not installed

from agents import Agent, Runner, TResponseInputItem
from agents.extensions.memory.dapr_session import DaprSession
from agents.extensions.memory.dapr_session import (
CONSISTENCY_EVENTUAL,
CONSISTENCY_STRONG,
DaprSession,
)
from tests.fake_model import FakeModel
from tests.test_responses import get_text_message

Expand Down Expand Up @@ -448,15 +452,15 @@ async def test_consistency_levels(fake_dapr_client: FakeDaprClient):
session_id="eventual_test",
state_store_name="statestore",
dapr_client=fake_dapr_client, # type: ignore[arg-type]
consistency="eventual",
consistency=CONSISTENCY_EVENTUAL,
)

# Test strong consistency
session_strong = DaprSession(
session_id="strong_test",
state_store_name="statestore",
dapr_client=fake_dapr_client, # type: ignore[arg-type]
consistency="strong",
consistency=CONSISTENCY_STRONG,
)

try:
Expand Down
Loading