Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
68f5fe2
start pydantic-ai-graph
samuelcolvin Dec 22, 2024
615c5e2
lower case state machine
samuelcolvin Dec 22, 2024
9ffe8f0
starting tests
samuelcolvin Dec 22, 2024
dd60d15
add history and logfire
samuelcolvin Dec 22, 2024
73db282
add example, alter types
samuelcolvin Dec 22, 2024
03fcaf2
fix dependencies
samuelcolvin Dec 23, 2024
1bae9bf
fix ci deps
samuelcolvin Dec 23, 2024
61f3d2b
fix tests for other versions
samuelcolvin Dec 23, 2024
dc769c9
change node test times
samuelcolvin Dec 23, 2024
b03e7bc
pydantic-ai-graph - simplify public generics (#539)
dmontagu Jan 2, 2025
d0bdb87
Typo in Graph Documentation (#596)
izzyacademy Jan 3, 2025
16ccd03
fix linting
samuelcolvin Jan 7, 2025
bda6dfb
separate mermaid logic
samuelcolvin Jan 7, 2025
cce71e1
fix graph type checking
samuelcolvin Jan 7, 2025
2d9f9f3
bump
samuelcolvin Jan 7, 2025
7e98bf7
adding node highlighting to mermaid, testing locally
samuelcolvin Jan 7, 2025
743fa5a
bump
samuelcolvin Jan 7, 2025
f6aa929
fix type checking imports
samuelcolvin Jan 7, 2025
246755d
fix for python 3.9
samuelcolvin Jan 7, 2025
d985db4
simplify mermaid config
samuelcolvin Jan 8, 2025
c325789
remove GraphRunner
samuelcolvin Jan 8, 2025
c41d59a
add Interrupt
samuelcolvin Jan 9, 2025
0b19632
remove interrupt, replace with "next()"
samuelcolvin Jan 9, 2025
c1b8035
address comments
samuelcolvin Jan 9, 2025
7e24d9d
switch name to pydantic-graph
samuelcolvin Jan 10, 2025
b74d0e4
allow labeling edges and notes for docstrings
samuelcolvin Jan 10, 2025
7f34a0d
allow notes to be disabled
samuelcolvin Jan 10, 2025
15573e9
adding graph tests
samuelcolvin Jan 10, 2025
de6b9e7
more mermaid tests, fix 3.9
samuelcolvin Jan 10, 2025
08e87aa
rename node to start_node in graph.run()
samuelcolvin Jan 10, 2025
25d79aa
more tests for graphs
samuelcolvin Jan 10, 2025
6e62906
coverage in tests
samuelcolvin Jan 10, 2025
c9ebc49
cleanup graph properties
samuelcolvin Jan 10, 2025
997ba99
infer graph name
samuelcolvin Jan 11, 2025
3b22850
fix for 3.9
samuelcolvin Jan 11, 2025
452a62f
adding API docs
samuelcolvin Jan 11, 2025
707129f
fix state, more docs
samuelcolvin Jan 11, 2025
80d4713
fix graph api examples
samuelcolvin Jan 11, 2025
be1563d
starting graph documentation
samuelcolvin Jan 11, 2025
6fdd1e9
fix examples
samuelcolvin Jan 11, 2025
a882a6c
more graph documentation
samuelcolvin Jan 11, 2025
f2cd72a
add GenAI example
samuelcolvin Jan 11, 2025
111f2d0
more graph docs
samuelcolvin Jan 12, 2025
5d0a834
extending graph docs
samuelcolvin Jan 13, 2025
9a7ab8e
fix history serialization
samuelcolvin Jan 14, 2025
4cd9142
add history (de)serialization tests
samuelcolvin Jan 14, 2025
598fdd6
add mermaid diagram section to graph docs
samuelcolvin Jan 14, 2025
bf8b824
fix tests
samuelcolvin Jan 14, 2025
aec8fab
add exceptions docs
samuelcolvin Jan 14, 2025
7d4f31d
docs tweaks
samuelcolvin Jan 14, 2025
79cb2b3
copy edits from @dmontagu
samuelcolvin Jan 15, 2025
38a787e
fix pydantic-graph readme
samuelcolvin Jan 15, 2025
6db58d6
snapshot state after node execution, not before
samuelcolvin Jan 15, 2025
326e5f5
improve history (de)serialization
samuelcolvin Jan 15, 2025
5b8433b
fix for older python
samuelcolvin Jan 15, 2025
b4e44bf
Graph deps (#693)
samuelcolvin Jan 15, 2025
a2144d6
docs comments, GraphContext -> GraphRunContext
samuelcolvin Jan 15, 2025
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
Prev Previous commit
Next Next commit
fix tests for other versions
  • Loading branch information
samuelcolvin committed Jan 15, 2025
commit 61f3d2b7710ee0e943526be85b9e8e11a1101e0d
6 changes: 5 additions & 1 deletion pydantic_ai_graph/pydantic_ai_graph/_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from __future__ import annotations as _annotations

import sys
import types
from typing import Any, TypeAliasType, Union, get_args, get_origin
from typing import Any, Union, get_args, get_origin

from typing_extensions import TypeAliasType


def get_union_args(tp: Any) -> tuple[Any, ...]:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_graph.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations as _annotations

from datetime import timezone
from typing import Union

import pytest
from inline_snapshot import snapshot
Expand All @@ -22,7 +23,7 @@ async def run(self, ctx: GraphContext) -> Double:
return Double(len(self.input_data))

class Double(BaseNode[None, int, int]):
async def run(self, ctx: GraphContext) -> String2Length | End[int]:
async def run(self, ctx: GraphContext) -> Union[String2Length, End[int]]: # noqa: UP007
if self.input_data == 7:
return String2Length('x' * 21)
else:
Expand Down