deploy
This commit is contained in:
58
agent.py
Normal file
58
agent.py
Normal file
@@ -0,0 +1,58 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from a2a_pack import (
|
||||
EgressPolicy,
|
||||
LLMProvisioning,
|
||||
MetaAgent,
|
||||
MetaAgentManifest,
|
||||
NoAuth,
|
||||
Resources,
|
||||
WorkspaceAccess,
|
||||
WorkspaceMode,
|
||||
)
|
||||
|
||||
|
||||
META_AGENT_MANIFEST = MetaAgentManifest.from_mapping(
|
||||
json.loads("{\n \"composition\": {\n \"max_nodes\": 8,\n \"max_parallel\": 3,\n \"max_replans\": 1,\n \"planning\": \"llm_dag\",\n \"sub_agents\": [\n {\n \"default_args\": {},\n \"name\": \"blog-openapi-agent\",\n \"required\": true,\n \"skills\": [\n \"auto\",\n \"get_blog_health\",\n \"list_blog_posts\",\n \"create_blog_post\",\n \"get_blog_post\",\n \"upsert_blog_post\",\n \"delete_blog_post\"\n ]\n },\n {\n \"default_args\": {},\n \"name\": \"google-trends-agent\",\n \"required\": true,\n \"skills\": [\n \"fetch\",\n \"fetch_structured\"\n ]\n }\n ]\n },\n \"goal\": {\n \"constraints\": [],\n \"objective\": \"Figure out what kind of blog content works\",\n \"success_criteria\": []\n },\n \"memory\": {\n \"namespace\": \"metatest\",\n \"retention\": \"durable\",\n \"scope\": \"agent\",\n \"tiers\": [\n \"files\",\n \"kv\",\n \"vector\"\n ]\n }\n}")
|
||||
)
|
||||
|
||||
|
||||
class MetatestConfig(BaseModel):
|
||||
pass
|
||||
|
||||
|
||||
class Metatest(MetaAgent[MetatestConfig, NoAuth]):
|
||||
name = "metatest"
|
||||
description = "Manifest-backed meta-agent composed in the dashboard."
|
||||
version = "0.1.0"
|
||||
config_model = MetatestConfig
|
||||
auth_model = NoAuth
|
||||
meta_agent_manifest = META_AGENT_MANIFEST
|
||||
llm_provisioning = LLMProvisioning.PLATFORM_OR_CALLER_PROVIDED
|
||||
wants_cp_jwt = True
|
||||
resources = Resources(cpu="500m", memory="1Gi", max_runtime_seconds=900)
|
||||
egress = EgressPolicy(
|
||||
allow_internal_services=(
|
||||
"control-plane.control-plane.svc.cluster.local",
|
||||
"litellm.llm.svc.cluster.local",
|
||||
),
|
||||
deny_internet_by_default=False,
|
||||
)
|
||||
workspace_access = WorkspaceAccess.dynamic(
|
||||
max_files=100,
|
||||
allowed_modes=(
|
||||
WorkspaceMode.READ_ONLY,
|
||||
WorkspaceMode.READ_WRITE_OVERLAY,
|
||||
),
|
||||
deny_patterns=(
|
||||
"secrets/**",
|
||||
".env",
|
||||
"**/.env",
|
||||
"**/.git/**",
|
||||
),
|
||||
require_human_approval=False,
|
||||
)
|
||||
Reference in New Issue
Block a user