Commit Graph

3 Commits

Author SHA1 Message Date
Roberto Rodriguez 3e767e03fb
Refactor agent workflows, orchestrators, and integrations for reliability and modularity (#161)
* Remove cookbook to avoid confusion

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Update Hugging Face integration and quickstart to use SmolLM3-3B model

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Refactor Agent and AgentBase for improved tool execution, prompt handling, and message metadata

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Refactor workflow features into mixins for messaging, pub/sub, state management, and service logic

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Refactor DurableAgent for improved workflow state, tool execution, and message handling

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Refactor workflow base and AgenticWorkflow to modularize Dapr integration and delegate service/state logic to mixins

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Update text printer logic to flush messages

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Split Workflow decorators for better organization.

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Refactor ConversationDaprStateMemory to return full message objects and improve logging.

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Refactor VectorStoreBase to return document IDs

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Refactor orchestrators to standardize broadcast messages, unify decorator imports, and improve workflow robustness

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Test quickstarts to validate all changes and update main README

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Set broadcast_topic_name to None to disable broadcasting

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Improve package exports and clean up imports for linter compliance

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Fix code style and lint errors flagged by Ruff

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Fix mypy type errors and improve

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Fix lint errors and code style issues with ruff

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* fix mypy attr-defined and call-arg errors

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* fix lint errors and code style issues

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* mypy type errors

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Updated test state class to DurableAgentWorkflowEntry

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Fix mypy errors

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Set DurableAgent to not broadcast messages by default and clarified dapr client private attribute in agentic workflow

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Update tests with latest changes

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Minor updates identified while working on test files

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Clarify AgentTool use in docstrings

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Centralize tool_history and tool_choice in AgentBase and unify tool execution record schema for tool_history

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* fix mypy errors

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Update dapr_agents/agents/base.py

Update default basic agent prompt

Co-authored-by: Sam <sam@diagrid.io>
Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

* Update quickstarts/03-durable-agent-tool-call/durable_weather_agent.py

Update durable weather agent with the right comments

Co-authored-by: Sam <sam@diagrid.io>
Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>

---------

Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com>
Co-authored-by: Sam <sam@diagrid.io>
2025-07-28 07:40:58 -07:00
Sam 6d55c383b9
feat: unify agent types (#139)
* style: save my todo comments

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* feat: unify agent types and save my wip

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* feat: save as i got 03 poc quickstart working

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* feat: add durable agent examples and fixes

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix(bug): support both template formats

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix(bug): support our custom format with vars inline

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* feat: agent + durableagent types, new cfg class, updated quickstarts/docs

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: some clean up

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: more clean up on things reviewing my pr

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: just more clean up of logs

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: update docs

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: actorAgent -> assistantAgent and rm actoragent

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: make linter happy

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* test: add init test setup and cases

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* feat: save an ex i created for what openapi agent looks like

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: rm up openapi react agent ex

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: more clean up for now

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* refactor: rm openapireact + react agents

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* refactor: mv durable agent with agent

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: update imports

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* refactor: make agent + durable agent use same base class + rm config for now

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* tests: add some init tests

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: make linter happy

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: use tcp conn instead of app layer

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: make linter happy

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: make linter happy

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* tests: add agent class tests + some clean up

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* tests: add durableagent class tests

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: make linter happy

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: make linter happy

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: acct for linter errs

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: run ruff

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: address many tox -e type errs, fix class inheritance mvment, replace generic data types with specific types

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: final type fix

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: update docs on new quickstarts

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: tox -e ruff + clean up comments

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: update for tox -e flake8

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: clean up print outs

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* tests: make things testable and fix some existing test errs

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: clean up quickstarts, add tests i forgot earlier

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: last few fixes

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: tox -e ruff

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix(build): acct for build errs

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: add tox ini file

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: fix linter

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: acct for posthog breaking change

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: address feedback

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: push test fixes

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: rm actor references

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: tox -e ruff

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix(quickstart): use local agent updates

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: tox -e flake8 fixes

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: style dirs we want

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix(build): install test deps properly

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: see if this fixes build err

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix(cookbook): update one more reqs file to use local agent deps instead of old release tag

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: register agent properly in db

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: rm duplicate quickstart sample

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: make linter happy

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix: ruff check --fix .

Signed-off-by: Samantha Coyle <sam@diagrid.io>

---------

Signed-off-by: Samantha Coyle <sam@diagrid.io>
2025-07-07 07:36:23 -07:00
Sam cee485fbad
test: init test setup and some tests + dev docs and proper setup with pyproject.toml (#137)
* test: add init tests and setup for tests

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: clean up unused / autogen files now

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: ignore req files that we can now autogen

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: make linter happy

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix(build): pin deps

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* style: update doc ordering

Signed-off-by: Samantha Coyle <sam@diagrid.io>

* fix(build): update imports

Signed-off-by: Samantha Coyle <sam@diagrid.io>

---------

Signed-off-by: Samantha Coyle <sam@diagrid.io>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
2025-06-30 14:36:05 -07:00