Skip to content

Commit 8f66e0f

Browse files
Merge pull request #86 from askui/refactor/make-agents-more-composeable
refactor!: make agents more composable
2 parents 1886d47 + 5b3f9bb commit 8f66e0f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1559
-1965
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ Here's how to create and use custom models:
287287
import functools
288288
from askui import (
289289
ActModel,
290+
ActSettings,
290291
GetModel,
291292
LocateModel,
292293
Locator,
@@ -310,6 +311,8 @@ class MyActModel(ActModel):
310311
messages: list[MessageParam],
311312
model_choice: str,
312313
on_message: OnMessageCb | None = None,
314+
tools: list[Tool] | None = None,
315+
settings: ActSettings | None = None,
313316
) -> None:
314317
# Implement custom act logic, e.g.:
315318
# - Use a different AI model
@@ -389,6 +392,8 @@ class DynamicActModel(ActModel):
389392
messages: list[MessageParam],
390393
model_choice: str,
391394
on_message: OnMessageCb | None = None,
395+
tools: list[Tool] | None = None,
396+
settings: ActSettings | None = None,
392397
) -> None:
393398
pass
394399

src/askui/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,16 @@
3131
ToolUseBlockParam,
3232
UrlImageSourceParam,
3333
)
34+
from .models.shared.settings import ActSettings, MessageSettings
35+
from .models.shared.tools import Tool
3436
from .models.types.response_schemas import ResponseSchema, ResponseSchemaBase
3537
from .retry import ConfigurableRetry, Retry
3638
from .tools import ModifierKey, PcKey
3739
from .utils.image_utils import ImageSource, Img
3840

3941
__all__ = [
4042
"ActModel",
43+
"ActSettings",
4144
"Base64ImageSourceParam",
4245
"CacheControlEphemeralParam",
4346
"CitationCharLocationParam",
@@ -52,6 +55,7 @@
5255
"LocateModel",
5356
"Locator",
5457
"MessageParam",
58+
"MessageSettings",
5559
"Model",
5660
"ModelChoice",
5761
"ModelComposition",
@@ -67,6 +71,7 @@
6771
"Retry",
6872
"TextBlockParam",
6973
"TextCitationParam",
74+
"Tool",
7075
"ToolResultBlockParam",
7176
"ToolUseBlockParam",
7277
"UrlImageSourceParam",

0 commit comments

Comments
 (0)