Skip to content
Closed
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
8cfe854
Adding lexical context collection
datvo06 Dec 8, 2025
4122acc
Allow model input to refer to anything within the lexical context
datvo06 Dec 8, 2025
28fc2c9
Different handling between representable object and other types when …
datvo06 Dec 8, 2025
126cab4
More edge case handling
datvo06 Dec 9, 2025
bec5e06
More edge case handling
datvo06 Dec 9, 2025
a768749
More edge case handling
datvo06 Dec 9, 2025
aabb0b7
Adding mypy check and test
datvo06 Dec 4, 2025
55cd283
SynthesizedFunction for constrained decoding, adapt the tests
datvo06 Dec 4, 2025
a232926
Linting
datvo06 Dec 4, 2025
61a9432
Let LLM generate param names
datvo06 Dec 4, 2025
6135eee
Pydantic field annotation
datvo06 Dec 4, 2025
cb3cb07
Merging notebook
datvo06 Dec 9, 2025
40413c5
Linting
datvo06 Dec 4, 2025
4d7867b
Fix minor formatting for type context
datvo06 Dec 5, 2025
ce8ebcf
Update llm dependencies to include mypy
datvo06 Dec 5, 2025
246b980
More comprehensive error message
datvo06 Dec 5, 2025
90d933c
linting
datvo06 Dec 5, 2025
ac2c953
More comprehensive import
datvo06 Dec 5, 2025
403a46d
Merging lexical context
datvo06 Dec 9, 2025
bce39c9
Merging lexical context
datvo06 Dec 9, 2025
64ecc63
Merging lexical context
datvo06 Dec 9, 2025
04d5622
Lint
datvo06 Dec 9, 2025
e3741aa
More refractoring to use the lexical context instead of collected typ…
datvo06 Dec 9, 2025
362e773
Bring constrained decoding back to synthesized function
datvo06 Dec 9, 2025
81a993b
Remove redundant format signature and rely on mypy to check for type …
datvo06 Dec 9, 2025
a2ada49
Revert change
datvo06 Dec 15, 2025
3d4aac7
Using lexical context
datvo06 Dec 16, 2025
80d0353
removing lexical context docstring
datvo06 Dec 16, 2025
79f07a4
Using Encodable as interface and resolve merge conflicts
datvo06 Dec 16, 2025
d2abb9e
Linting
datvo06 Dec 16, 2025
e3374f6
Attaching source code to the function
datvo06 Dec 16, 2025
535d9fc
Attaching source code to the function
datvo06 Dec 16, 2025
3d1074c
Attaching source code to the function
datvo06 Dec 16, 2025
a366598
Factor out program synthesis test to be less flaky
datvo06 Dec 16, 2025
aa4a98c
Linting
datvo06 Dec 16, 2025
ad4d603
Factor out image LLM test for less flaky
datvo06 Dec 16, 2025
7aaa173
Linting
datvo06 Dec 16, 2025
8dd6f16
Include factored out test
datvo06 Dec 16, 2025
8f8c614
Fix TypeError weak reference to str
datvo06 Dec 16, 2025
8b0251c
Fix misisng collections import
datvo06 Dec 16, 2025
5a6a8ea
Linting
datvo06 Dec 16, 2025
53b2b95
Add immutable lexical context test
datvo06 Dec 16, 2025
324f23c
Initial Class Synthesis Attempt
datvo06 Dec 16, 2025
62c649a
Readding type check mypy
datvo06 Dec 16, 2025
f4da230
Merge branch 'type_context' of https://github.com/BasisResearch/effec…
datvo06 Dec 16, 2025
23309f1
Update synthesis prompt so that it will not misunderstand and return …
datvo06 Dec 16, 2025
54b72ea
Update
datvo06 Dec 16, 2025
59ecdd0
Update prompt to avoid factory generation again
datvo06 Dec 16, 2025
fa9fbc9
Merge branch 'type_context' of https://github.com/BasisResearch/effec…
datvo06 Dec 16, 2025
ae62b24
Remove duplicated import
datvo06 Dec 17, 2025
7ac9471
Remove unnecesary redefinition
datvo06 Dec 17, 2025
feb41f9
Merge branch 'type_context' of https://github.com/BasisResearch/effec…
datvo06 Dec 17, 2025
b034aa8
Working inspect get source for type
datvo06 Dec 17, 2025
0902491
Lint
datvo06 Dec 17, 2025
f85bd43
Fix python 3.13+ compatibility
datvo06 Dec 17, 2025
dfd22eb
Lint
datvo06 Dec 17, 2025
af01df4
Lint
datvo06 Dec 17, 2025
ba3c1c8
Lint
datvo06 Dec 17, 2025
00dc079
More 3.13+ compatibility
datvo06 Dec 17, 2025
f7263a0
Minor
datvo06 Dec 17, 2025
eb8a2a3
More compatibility fixing
datvo06 Dec 17, 2025
50ce47c
EncodableSynthesizedFunction
datvo06 Dec 22, 2025
45083c6
Merge branch 'staging-llm' of https://github.com/BasisResearch/effect…
datvo06 Dec 23, 2025
b0f28e7
Passing test
datvo06 Dec 23, 2025
7abea68
Linting
datvo06 Dec 23, 2025
19fbfa4
Trim decode changes
datvo06 Dec 23, 2025
ada8512
Linting tests
datvo06 Dec 23, 2025
e6e21bb
Minor
datvo06 Dec 23, 2025
13f41ee
Merge staging-llm
datvo06 Jan 2, 2026
74589b4
Minor fix and merge
datvo06 Jan 4, 2026
541d10f
Minor
datvo06 Jan 4, 2026
af65d9d
Minor
datvo06 Jan 4, 2026
1987bb5
Merge branch 'staging-llm' of https://github.com/basisresearch/effect…
datvo06 Jan 9, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/test_llm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: |
uv run pytest tests/test_handlers_llm_provider.py -v --tb=short
uv run pytest tests/test_handlers_llm_provider*.py -v --tb=short
218 changes: 128 additions & 90 deletions docs/source/llm.ipynb

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions effectful/handlers/llm/encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ def decode(cls, vl: T) -> T:
return typing.cast(Encodable[T], BaseEncodable())


# NOTE: Register str explicitly to avoid WeakKeyDictionary cache issues with singledispatch
@type_to_encodable_type.register(str)
def _type_encodable_type_str[T](ty: type[T]) -> Encodable[T]:
return _type_encodable_type_base(ty)


@type_to_encodable_type.register(pydantic.BaseModel)
def _type_encodable_type_pydantic_base_model[T: pydantic.BaseModel](
ty: type[T],
Expand Down
1 change: 0 additions & 1 deletion effectful/handlers/llm/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ def format_model_input[**P, T](
) -> list[Any]:
"""Format a template applied to arguments into a sequence of input
messages.

"""
bound_args = template.__signature__.bind(*args, **kwargs)
bound_args.apply_defaults()
Expand Down
Loading
Loading