You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Fix mas howto guide for new manifest models (#109)
* fix: more bugfixes
Signed-off-by: Jeff Napper <103025963+jnapper7@users.noreply.github.com>
* fix: fix error messages
Signed-off-by: Jeff Napper <103025963+jnapper7@users.noreply.github.com>
* fix: updates for new WFSM
Signed-off-by: Jeff Napper <103025963+jnapper7@users.noreply.github.com>
---------
Signed-off-by: Jeff Napper <103025963+jnapper7@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/pages/how-to-guides/agents/thread.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
Building Applications with ACP Threads
2
-
=====================================
2
+
======================================
3
3
4
4
ACP Node supports threads, where a thread contains the accumulated state of a sequence of runs.
5
5
@@ -24,7 +24,7 @@ Prerequisites
24
24
25
25
26
26
Implementation Walkthrough
27
-
-------------------
27
+
----------------------------
28
28
29
29
Together we will, create a LangGraph agent, deploy it on a Workflow Server, and utilize its threading capabilities. You can find the agent's source code here: `Mail Composer Agent Source Code <https://github.com/agntcy/agentic-apps/blob/main/mailcomposer/mailcomposer/mailcomposer.py>`_.
30
30
The agent we will work with is called **Mail Composer**, which specializes in composing emails for marketing campaigns.
At this point, if you want to run your application to see if it compiles [(as at the end of Step 1 above)](#skeleton-code-example), you will
436
+
need to set the `SENDGRID_API_KEY` in your environment. This depends on your operating system and
437
+
shell, but an example for most shells in most Unix-like OSes:
438
+
439
+
```shell
440
+
export SENDGRID_API_KEY="enter API key here"
441
+
```
442
+
435
443
For a complete setup guide including Tyk gateway configuration and SendGrid API details, see the [SendGrid API Bridge example in the ACP SDK documentation](https://docs.agntcy.org/pages/syntactic_sdk/api_bridge_agent.html#an-example-with-sendgrid-api).
436
444
437
445
@@ -670,6 +678,15 @@ With these additions, our application now has a complete workflow that can:
670
678
6. Provide meaningful output back to the user
671
679
672
680
681
+
At this point, if you want to run your application to see if it compiles [(as at the end of Step 1 above)](#skeleton-code-example), you will
682
+
need to set some variables for Azure in your environment. This depends on your operating system
683
+
and shell, but an example for most shells in most Unix-like OSes:
In this step, we will **generate the Agent Manifest**for our Marketing Campaign application. The manifest generation enables our application to be used by other applications and to be deployed through an [Agent Workflow Server](https://github.com/agntcy/workflow-srv).
@@ -685,94 +702,163 @@ Let's create a new file called `generate_manifest.py` in the `src/marketing_camp
685
702
686
703
```python
687
704
# src/marketing_campaign/generate_manifest.py
705
+
from datetime import datetime, timezone
688
706
from pathlib import Path
689
-
from pydantic import AnyUrl
690
-
from marketing_campaign.state import OverallState, ConfigModel
707
+
691
708
from agntcy_acp.manifest import (
692
-
AgentManifest,
693
-
AgentDeployment,
694
-
DeploymentOptions,
695
-
LangGraphConfig,
696
-
EnvVar,
697
-
AgentMetadata,
698
709
AgentACPSpec,
710
+
AgentDependency,
711
+
AgentDeployment,
712
+
AgentManifest,
699
713
AgentRef,
700
714
Capabilities,
715
+
DeploymentManifest,
716
+
DeploymentOptions,
717
+
EnvVar,
718
+
LangGraphConfig,
719
+
Locator,
720
+
Manifest,
721
+
Skill,
701
722
SourceCodeDeployment,
702
-
AgentDependency
723
+
OASF_EXTENSION_NAME_MANIFEST,
703
724
)
725
+
from pydantic import AnyUrl
726
+
727
+
from marketing_campaign.state import ConfigModel, OverallState
# Replace URLs with filesystem paths because file:// schema not yet supported on dependencies
767
-
json_content = json_content.replace(
768
-
f"file://{mailcomposer_dependency_manifest}",
769
-
mailcomposer_dependency_manifest
770
-
)
771
-
json_content = json_content.replace(
772
-
f"file://{email_reviewer_dependency_manifest}",
773
-
email_reviewer_dependency_manifest
858
+
exclude_unset=True, exclude_none=True, indent=2
774
859
)
775
860
f.write(json_content)
861
+
f.write("\n")
776
862
```
777
863
778
864
### Understanding the Manifest Generator Structure
@@ -836,11 +922,14 @@ After generating the manifest, we can deploy and run our application using the W
836
922
837
923
### Installing the Workflow Server Manager
838
924
839
-
First, download the Workflow Server Manager CLI appropriate for your operating system from the [releases page](https://github.com/agntcy/workflow-srv-mgr/releases). Make sure to execute these commands from the root directory of your project:
925
+
First, download the Workflow Server Manager CLI appropriate for your operating system from
926
+
the [releases page](https://github.com/agntcy/workflow-srv-mgr/releases). Note that the
927
+
latest version may be later (semantically) than the version in the example below. Make sure
928
+
to execute these commands from the root directory of your project:
840
929
841
930
```bash
842
931
# For macOS with Apple Silicon (run from project root)
>**Note**: Replace placeholder values with your actual API keys and endpoints. The `SENDGRID_HOST`isset to `http://host.docker.internal:8080` to allow communication with a API Bridge service that will locally run in Docker.
@@ -882,17 +982,18 @@ Before testing the full application workflow, you need to set up the SendGrid AP
882
982
Now, deploy the Marketing Campaign workflow server using the manifest we generated. Run this command from the root directory of your project:
0 commit comments