aigency 0.0.1rc15474277__py3-none-any.whl → 0.0.1rc235167702__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ from google.adk.runners import Runner
10
10
  from google.adk.sessions import InMemorySessionService
11
11
 
12
12
  from aigency.agents.executor import AgentA2AExecutor
13
- from aigency.models.config import AgentConfig
13
+ from aigency.schemas.aigency_config import AigencyConfig
14
14
  from aigency.tools.generator import ToolGenerator
15
15
 
16
16
 
@@ -18,22 +18,26 @@ class AgentA2AGenerator:
18
18
  """Generator for creating A2A agents and related components."""
19
19
 
20
20
  @staticmethod
21
- def create_agent(agent_config: AgentConfig) -> Agent:
21
+ def create_agent(agent_config: AigencyConfig) -> Agent:
22
+
23
+ tools = [
24
+ ToolGenerator.create_tool(tool_cfg) for tool_cfg in agent_config.agent.tools
25
+ ]
22
26
 
23
- tools = [ToolGenerator.create_tool(tool_cfg) for tool_cfg in agent_config.tools]
24
-
25
27
  return Agent(
26
- name=agent_config.name,
27
- model=agent_config.model.name,
28
- instruction=agent_config.instruction,
28
+ name=agent_config.metadata.name,
29
+ model=agent_config.agent.model.name,
30
+ instruction=agent_config.agent.instruction,
29
31
  tools=tools,
30
32
  )
31
33
 
32
34
  @staticmethod
33
- def build_agent_card(agent_config: AgentConfig) -> AgentCard:
35
+ def build_agent_card(agent_config: AigencyConfig) -> AgentCard:
34
36
 
35
37
  # TODO: Parse properly
36
- capabilities = AgentCapabilities(streaming=agent_config.capabilities.streaming)
38
+ capabilities = AgentCapabilities(
39
+ streaming=agent_config.service.capabilities.streaming
40
+ )
37
41
 
38
42
  skills = [
39
43
  AgentSkill(
@@ -43,24 +47,22 @@ class AgentA2AGenerator:
43
47
  tags=skill.tags,
44
48
  examples=skill.examples,
45
49
  )
46
- for skill in agent_config.skills
50
+ for skill in agent_config.agent.skills
47
51
  ]
48
52
 
49
53
  return AgentCard(
50
- name=agent_config.name,
51
- description=agent_config.description,
52
- url=agent_config.url,
53
- version=agent_config.version,
54
- default_input_modes=agent_config.default_input_modes,
55
- default_output_modes=agent_config.default_output_modes,
54
+ name=agent_config.metadata.name,
55
+ description=agent_config.metadata.description,
56
+ url=agent_config.service.url,
57
+ version=agent_config.metadata.version,
58
+ default_input_modes=agent_config.service.interface.default_input_modes,
59
+ default_output_modes=agent_config.service.interface.default_output_modes,
56
60
  capabilities=capabilities,
57
61
  skills=skills,
58
62
  )
59
63
 
60
64
  @staticmethod
61
- def build_executor(
62
- agent: Agent, agent_card: AgentCard
63
- ) -> AgentA2AExecutor:
65
+ def build_executor(agent: Agent, agent_card: AgentCard) -> AgentA2AExecutor:
64
66
 
65
67
  runner = Runner(
66
68
  app_name=agent.name,
@@ -0,0 +1,12 @@
1
+ from pydantic import BaseModel
2
+ from typing import List, Optional
3
+ from aigency.schemas.agent.model import AgentModel
4
+ from aigency.schemas.agent.skills import Skill
5
+ from aigency.schemas.agent.tools import FunctionTool, McpTool
6
+
7
+ class Agent(BaseModel):
8
+ """El 'cerebro' del agente: su lógica, modelo y capacidades."""
9
+ model: AgentModel
10
+ instruction: str
11
+ skills: List[Skill]
12
+ tools: Optional[List[FunctionTool | McpTool]] = []
@@ -0,0 +1,12 @@
1
+ from typing import Optional
2
+ from pydantic import BaseModel
3
+
4
+ class ProviderConfig(BaseModel):
5
+ """Configuration for AI model provider."""
6
+ name: str
7
+ endpoint: Optional[str] = None
8
+
9
+ class AgentModel(BaseModel):
10
+ """Configuration for AI model."""
11
+ name: str
12
+ provider: Optional[ProviderConfig] = None
@@ -0,0 +1,10 @@
1
+ from pydantic import BaseModel
2
+ from typing import List
3
+
4
+ class Skill(BaseModel):
5
+ """Define una habilidad específica del agente."""
6
+ id: str
7
+ name: str
8
+ description: str
9
+ tags: List[str]
10
+ examples: List[str]
@@ -0,0 +1,14 @@
1
+ from pydantic import BaseModel
2
+ from typing import Optional
3
+ from aigency.schemas.observability.observability import Observability
4
+ from aigency.schemas.metadata.metadata import Metadata
5
+ from aigency.schemas.agent.agent import Agent
6
+ from aigency.schemas.service.service import Service
7
+
8
+ class AigencyConfig(BaseModel):
9
+ """Root Pydantic model for complete agent configuration."""
10
+
11
+ metadata: Metadata
12
+ service: Service
13
+ agent: Agent
14
+ observability: Optional[Observability] = None
@@ -0,0 +1,8 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class Metadata(BaseModel):
5
+ """Metadatos descriptivos del agente."""
6
+ name: str
7
+ version: str
8
+ description: str
@@ -0,0 +1,10 @@
1
+ from pydantic import BaseModel
2
+ from aigency.schemas.observability.phoenix import Phoenix
3
+
4
+ class Monitoring(BaseModel):
5
+ """Configuración de las herramientas de monitoreo."""
6
+ phoenix: Phoenix
7
+
8
+ class Observability(BaseModel):
9
+ """Agrupa todas las configuraciones de observabilidad."""
10
+ monitoring: Monitoring
@@ -0,0 +1,6 @@
1
+ from pydantic import BaseModel
2
+
3
+ class Phoenix(BaseModel):
4
+ """Configuración del monitor Phoenix."""
5
+ host: str
6
+ port: int
@@ -0,0 +1,5 @@
1
+ from pydantic import BaseModel
2
+
3
+ class Capabilities(BaseModel):
4
+ """Capacidades técnicas del servicio del agente."""
5
+ streaming: bool
@@ -0,0 +1,7 @@
1
+ from typing import List
2
+ from pydantic import BaseModel
3
+
4
+ class Interface(BaseModel):
5
+ """Define los modos de comunicación del agente."""
6
+ default_input_modes: List[str]
7
+ default_output_modes: List[str]
@@ -0,0 +1,9 @@
1
+ from pydantic import BaseModel
2
+ from aigency.schemas.service.interface import Interface
3
+ from aigency.schemas.service.capabilities import Capabilities
4
+
5
+ class Service(BaseModel):
6
+ """Configuración de red y comunicación del agente."""
7
+ url: str
8
+ interface: Interface
9
+ capabilities: Capabilities
@@ -14,7 +14,7 @@ from google.adk.tools.mcp_tool.mcp_toolset import (
14
14
  StreamableHTTPConnectionParams,
15
15
  )
16
16
 
17
- from aigency.models.tools import (
17
+ from aigency.schemas.agent.tools import (
18
18
  FunctionTool,
19
19
  McpTool,
20
20
  McpTypeStdio,
@@ -43,11 +43,7 @@ class ToolGenerator:
43
43
 
44
44
  if isinstance(config.mcp_config, McpTypeStreamable):
45
45
  url = f"http://{config.mcp_config.url}:{config.mcp_config.port}{config.mcp_config.path}"
46
- return MCPToolset(
47
- connection_params=StreamableHTTPConnectionParams(
48
- url=url
49
- )
50
- )
46
+ return MCPToolset(connection_params=StreamableHTTPConnectionParams(url=url))
51
47
  elif isinstance(config.mcp_config, McpTypeStdio):
52
48
  command = config.mcp_config.command
53
49
  args = config.mcp_config.args
@@ -65,7 +61,7 @@ class ToolGenerator:
65
61
  ToolType.MCP: load_mcp_tool,
66
62
  ToolType.FUNCTION: load_function_tool,
67
63
  }
68
-
64
+
69
65
  @staticmethod
70
66
  def create_tool(tool: Tool) -> Optional[Any]:
71
67
  """Create a tool based on its configuration.
@@ -6,36 +6,46 @@ from typing import Any, Dict, Optional
6
6
 
7
7
  import yaml
8
8
 
9
- from aigency.models.config import AgentConfig
9
+ from aigency.schemas.aigency_config import AigencyConfig
10
10
  from aigency.utils.logger import get_logger
11
11
 
12
12
 
13
13
  logger = get_logger()
14
14
 
15
+
15
16
  class ConfigService:
16
17
  """Service for loading and managing agent configurations."""
18
+
17
19
  def __init__(self, config_file: str, environment: Optional[str] = None):
18
20
  self.config_file = config_file
19
- self.environment = environment or os.getenv('ENVIRONMENT', None)
21
+ self.environment = environment or os.getenv("ENVIRONMENT", None)
20
22
  self.config = self._load_and_parse()
21
23
 
22
- def _load_and_parse(self) -> AgentConfig:
23
- """Carga los YAMLs, los mergea y parsea según AgentConfig."""
24
+ def _load_and_parse(self) -> AigencyConfig:
25
+ """Carga los YAMLs, los mergea y parsea según AigencyConfig."""
24
26
 
25
27
  logger.info(f"Loading configuration from {self.config_file}")
26
28
  config = self._load_yaml(self.config_file)
27
29
 
28
30
  if self.environment is not None:
29
- logger.info(f"Environment '{self.environment}' detected, loading environment-specific configuration")
31
+ logger.info(
32
+ f"Environment '{self.environment}' detected, loading environment-specific configuration"
33
+ )
30
34
  env_config = self._load_env_config()
31
35
  if env_config:
32
- logger.info(f"Successfully loaded environment configuration with {len(env_config)} keys: {list(env_config.keys())}")
36
+ logger.info(
37
+ f"Successfully loaded environment configuration with {len(env_config)} keys: {list(env_config.keys())}"
38
+ )
33
39
  config = self._merge_configs(config, env_config)
34
- logger.debug(f"Configuration merged successfully for environment '{self.environment}'")
40
+ logger.debug(
41
+ f"Configuration merged successfully for environment '{self.environment}'"
42
+ )
35
43
  else:
36
- logger.warning(f"No environment-specific configuration found for '{self.environment}', using base configuration only")
37
-
38
- return AgentConfig(**config)
44
+ logger.warning(
45
+ f"No environment-specific configuration found for '{self.environment}', using base configuration only"
46
+ )
47
+
48
+ return AigencyConfig(**config)
39
49
 
40
50
  def _load_yaml(self, file_path: str) -> Dict[str, Any]:
41
51
  """Carga un archivo YAML."""
@@ -43,26 +53,37 @@ class ConfigService:
43
53
  with open(file_path, "r", encoding="utf-8") as file:
44
54
  return yaml.safe_load(file) or {}
45
55
  except FileNotFoundError:
46
- raise FileNotFoundError(f"Archivo de configuración no encontrado: {file_path}")
56
+ raise FileNotFoundError(
57
+ f"Archivo de configuración no encontrado: {file_path}"
58
+ )
47
59
  except yaml.YAMLError as e:
48
60
  raise ValueError(f"Error al parsear YAML {file_path}: {e}")
49
61
 
50
62
  def _load_env_config(self) -> Optional[Dict[str, Any]]:
51
63
  """Carga configuración específica del entorno."""
52
64
  config_path = Path(self.config_file)
53
- env_file = config_path.parent / f"{config_path.stem}.{self.environment}{config_path.suffix}"
54
-
65
+ env_file = (
66
+ config_path.parent
67
+ / f"{config_path.stem}.{self.environment}{config_path.suffix}"
68
+ )
69
+
55
70
  return self._load_yaml(str(env_file)) if env_file.exists() else None
56
71
 
57
- def _merge_configs(self, base: Dict[str, Any], env: Optional[Dict[str, Any]]) -> Dict[str, Any]:
72
+ def _merge_configs(
73
+ self, base: Dict[str, Any], env: Optional[Dict[str, Any]]
74
+ ) -> Dict[str, Any]:
58
75
  """Mergea configuración base con configuración de entorno."""
59
76
  if not env:
60
77
  return base
61
-
78
+
62
79
  result = base.copy()
63
80
  for key, value in env.items():
64
- if key in result and isinstance(result[key], dict) and isinstance(value, dict):
81
+ if (
82
+ key in result
83
+ and isinstance(result[key], dict)
84
+ and isinstance(value, dict)
85
+ ):
65
86
  result[key] = self._merge_configs(result[key], value)
66
87
  else:
67
88
  result[key] = value
68
- return result
89
+ return result
@@ -0,0 +1,267 @@
1
+ Metadata-Version: 2.4
2
+ Name: aigency
3
+ Version: 0.0.1rc235167702
4
+ Summary: Add your description here
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: google-adk>=1.11.0
8
+ Requires-Dist: a2a-sdk==0.3.0
9
+ Requires-Dist: litellm<1.73.0,>=1.72.6
10
+ Requires-Dist: pyyaml==6.0.2
11
+ Requires-Dist: PyJWT==2.10.1
12
+
13
+ # aigency-lib
14
+
15
+ A library for creating and managing AI agents.
16
+
17
+ ## Quick Start
18
+
19
+ To test a simple agent:
20
+
21
+ ```bash
22
+ cd examples/simple_agents/hello_world_agent
23
+ docker compose up
24
+ ```
25
+
26
+ ## 🔧 Version Management
27
+
28
+ This project includes an automated system for managing versions in both development and production.
29
+
30
+ ### Version Manager
31
+
32
+ The `scripts/version_manager.py` script helps you manage your package versions locally.
33
+
34
+ #### Available Commands
35
+
36
+ ##### 1. View current information
37
+ ```bash
38
+ python scripts/version_manager.py show
39
+ ```
40
+ **What it does:**
41
+ - Shows the current version in `pyproject.toml`
42
+ - Shows the current git branch
43
+ - Shows the current commit
44
+ - If you're not on `main`, suggests a development version
45
+
46
+ **Example output:**
47
+ ```
48
+ Current version: 0.0.1
49
+ Branch: feature/new-agent
50
+ Commit: a1b2c3d
51
+ Suggested dev version: 0.0.1.dev20250409143022+feature/new-agent.a1b2c3d
52
+ ```
53
+
54
+ ##### 2. Create development version
55
+ ```bash
56
+ python scripts/version_manager.py dev
57
+ ```
58
+ **What it does:**
59
+ - Takes the current version and creates a development version
60
+ - Format: `version.devYYYYMMDDHHMMSS+branch.commit`
61
+ - Automatically updates the `pyproject.toml`
62
+
63
+ **Example:**
64
+ ```bash
65
+ # If you're on branch "feature/auth" with commit "abc123"
66
+ python scripts/version_manager.py dev
67
+ # Result: 0.0.1.dev20250409143022
68
+ ```
69
+
70
+ ##### 3. Set specific version
71
+ ```bash
72
+ python scripts/version_manager.py set --version "0.1.0"
73
+ ```
74
+ **What it does:**
75
+ - Changes the version to the one you specify
76
+ - Useful for releases or to fix versions
77
+
78
+ **Examples:**
79
+ ```bash
80
+ # Release version
81
+ python scripts/version_manager.py set --version "1.0.0"
82
+
83
+ # Beta version
84
+ python scripts/version_manager.py set --version "1.0.0b1"
85
+
86
+ # Alpha version
87
+ python scripts/version_manager.py set --version "1.0.0a1"
88
+ ```
89
+
90
+ ##### 4. Create Release Candidate version
91
+ ```bash
92
+ python scripts/version_manager.py rc --version "1.0.1"
93
+ ```
94
+ **What it does:**
95
+ - Creates an RC version with the format `version-rc<commit>`
96
+ - Useful for preparing releases on `release/*` branches
97
+
98
+ ##### 5. Validate current version
99
+ ```bash
100
+ python scripts/version_manager.py validate
101
+ ```
102
+ **What it does:**
103
+ - Validates that the current version is appropriate for the branch
104
+ - Verifies semantic format on `main` and `release/*` branches
105
+
106
+ ##### 6. Create dev with custom base version
107
+ ```bash
108
+ python scripts/version_manager.py dev --base-version "0.2.0"
109
+ ```
110
+ **What it does:**
111
+ - Uses a different base version than the current one
112
+ - Useful when you want to prepare a dev version for the next release
113
+
114
+ ### 🚀 Recommended Workflow
115
+
116
+ #### For daily development:
117
+ ```bash
118
+ # 1. View current status
119
+ python scripts/version_manager.py show
120
+
121
+ # 2. If you're on a feature branch, create dev version
122
+ python scripts/version_manager.py dev
123
+
124
+ # 3. Make your changes and commits
125
+ git add .
126
+ git commit -m "feat: new functionality"
127
+
128
+ # 4. If you need to update the dev version (optional)
129
+ python scripts/version_manager.py dev
130
+ ```
131
+
132
+ #### For releases:
133
+ ```bash
134
+ # 1. On main branch, set release version
135
+ python scripts/version_manager.py set --version "1.0.0"
136
+
137
+ # 2. Commit the version
138
+ git add pyproject.toml
139
+ git commit -m "bump: version 1.0.0"
140
+
141
+ # 3. Use GitHub workflow to publish
142
+ ```
143
+
144
+ #### For testing:
145
+ ```bash
146
+ # Create specific test version
147
+ python scripts/version_manager.py set --version "1.0.0rc1"
148
+ ```
149
+
150
+ ### ⚠️ PyPI Limitations
151
+
152
+ PyPI doesn't allow "local versions" (versions with `+` and local identifiers). That's why we've adapted the format:
153
+
154
+ - ❌ Not allowed: `1.0.0.dev20250409+feature.abc123`
155
+ - ✅ Allowed: `1.0.0.dev20250409`
156
+
157
+ **Solution for Release Candidates:**
158
+ - We convert the commit hash (hexadecimal) to decimal
159
+ - Example: commit `abc123` → `11256099` → version `1.0.1rc11256099`
160
+ - This maintains commit uniqueness in a PyPI-compatible format
161
+
162
+ **Result:**
163
+ - Dev versions include unique timestamp
164
+ - RC versions include commit hash (in decimal)
165
+ - We maintain traceability without using local versions
166
+
167
+ ### 📋 Practical Use Cases
168
+
169
+ **Scenario 1: Working on a feature**
170
+ ```bash
171
+ git checkout -b feature/new-auth
172
+ python scripts/version_manager.py dev
173
+ # Now you have: 0.0.1.dev20250409143022
174
+ ```
175
+
176
+ **Scenario 2: Preparing release**
177
+ ```bash
178
+ git checkout main
179
+ python scripts/version_manager.py set --version "1.0.0"
180
+ git add pyproject.toml
181
+ git commit -m "release: v1.0.0"
182
+ ```
183
+
184
+ **Scenario 3: Preparing Release Candidate**
185
+ ```bash
186
+ git checkout -b release/1.0.1
187
+ python scripts/version_manager.py rc --version "1.0.1"
188
+ # Result: 1.0.1rc12345678 (where 12345678 is the commit hash in decimal)
189
+ ```
190
+
191
+ **Scenario 4: Urgent hotfix**
192
+ ```bash
193
+ git checkout -b hotfix/critical-bug
194
+ python scripts/version_manager.py dev --base-version "1.0.1"
195
+ # Result: 1.0.1.dev20250409143022
196
+ ```
197
+
198
+ ## 🔄 Intelligent CI/CD Workflow
199
+
200
+ The project includes a single intelligent workflow (`python-publish.yml`) that automatically handles different version types based on the branch:
201
+
202
+ ### Automatic behavior by branch:
203
+
204
+ #### 🚀 `main` Branch - Production Versions
205
+ - **Trigger**: Push to `main` or manual execution
206
+ - **Version**: Uses exactly the version from `pyproject.toml`
207
+ - **Validations**:
208
+ - ✅ Verifies it's a valid semantic version (e.g.: `1.0.0`)
209
+ - ✅ Verifies it doesn't already exist on PyPI
210
+ - ❌ Fails if it contains development suffixes (`dev`, `rc`, `alpha`, `beta`)
211
+ - **Target**: PyPI production
212
+
213
+ #### 🎯 `release/*` Branches - Release Candidates
214
+ - **Trigger**: Push to `release/X.Y.Z` branch or manual execution
215
+ - **Version**: `X.Y.ZrcN` where N is the commit hash in decimal (e.g.: `1.0.1rc12345678`)
216
+ - **Validations**:
217
+ - ✅ Verifies that `X.Y.Z` is a valid semantic version
218
+ - ✅ Extracts version from branch name
219
+ - ✅ Uses commit hash as unique identifier
220
+ - ✅ PyPI-compatible format
221
+ - **Target**: PyPI production
222
+ - **Example**: Branch `release/1.0.1` + commit `abc123` → Version `1.0.1rc11256099`
223
+
224
+ #### 🔧 Other Branches - Development Versions
225
+ - **Trigger**: Push to any other branch or manual execution
226
+ - **Version**: `current.devYYYYMMDDHHMMSS` (e.g.: `0.0.1.dev20250409143022`)
227
+ - **Target**: PyPI production
228
+ - **Note**: No local versions for PyPI compatibility
229
+
230
+ ### Recommended workflow:
231
+
232
+ ```bash
233
+ # 1. Development on feature branch
234
+ git checkout -b feature/new-functionality
235
+ # Automatic version: 0.0.1.dev20250409143022+feature-new-functionality.abc123
236
+
237
+ # 2. Prepare release
238
+ git checkout -b release/1.0.0
239
+ git push origin release/1.0.0
240
+ # Automatic version: 1.0.0rc12345678
241
+
242
+ # 3. Final release
243
+ git checkout main
244
+ python scripts/version_manager.py set --version "1.0.0"
245
+ git add pyproject.toml
246
+ git commit -m "release: v1.0.0"
247
+ git push origin main
248
+ # Version: 1.0.0 (with validations)
249
+ ```
250
+
251
+ ## 📦 Installation
252
+
253
+ ```bash
254
+ pip install aigency
255
+ ```
256
+
257
+ ## 🛠️ Development
258
+
259
+ 1. Clone the repository
260
+ 2. Install development dependencies
261
+ 3. Use the version manager to manage versions during development
262
+
263
+ ```bash
264
+ git clone <repo-url>
265
+ cd aigency-lib
266
+ pip install -e .
267
+ ```
@@ -0,0 +1,23 @@
1
+ aigency/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ aigency/agents/executor.py,sha256=ozT0wMwHLfyHi7bLcIPvs1gqnuj8w33SzlsSLB0W55k,5276
3
+ aigency/agents/generator.py,sha256=I3TFZYFHF5GIH2Piuwe-7o5g7rpha4g1I93-ARqDrEk,2508
4
+ aigency/schemas/aigency_config.py,sha256=trFOLAFCekuBtEcCofMTXw_e_d7DRMB9UYum9Ci8Qg4,491
5
+ aigency/schemas/agent/agent.py,sha256=3Fm0tN3QG6hhxs0uo8Z2grb8SUeGS1t632Zqqcdaw18,440
6
+ aigency/schemas/agent/model.py,sha256=8gY7xXJdpePESctRDMMFfXIZbRtHJEbIXSyvy89Bbyo,316
7
+ aigency/schemas/agent/skills.py,sha256=5yhcoQmadaCf0Yg67PuOGDWy3ZIA-T-8dZ0uRyJw0EE,225
8
+ aigency/schemas/agent/tools.py,sha256=VXdA0cKptAzu-4Oa0McxoI7uZtpsGXjXfAxUKzv2f4E,885
9
+ aigency/schemas/metadata/metadata.py,sha256=wu4TM8f8eOMb40-uOLRffJjgGptW_KVOablW4EpJBLc,156
10
+ aigency/schemas/observability/observability.py,sha256=WEeXyCrow9j2VO6HS7tOPkcKItISYsVfmHzGM-ap9nQ,320
11
+ aigency/schemas/observability/phoenix.py,sha256=bTJ2vhe2Khtme5h5mCHEVH1o4LJAQ8GcKP6rkjPMpjo,131
12
+ aigency/schemas/service/capabilities.py,sha256=vhMHP5pIYeOQTD-aBs79p_g5O3soHb5asfc_UhS1OFA,139
13
+ aigency/schemas/service/interface.py,sha256=csYJhwbD9M29LrCnd1G6pBYagFauJ-WRSfrK8NIU9oI,210
14
+ aigency/schemas/service/service.py,sha256=OajLiu5ICUFUi-M8yB9nH9jKbEuBUV6foIVcPfqx9QI,304
15
+ aigency/tools/generator.py,sha256=sXqZBiHMCZN6iwyXBk7gTrvIN3plNEuWqwwD1heFGc8,2446
16
+ aigency/utils/config_service.py,sha256=yN0Hj_IsDSSoTM4cYmBvR_x6vZ4bsxkoPc3Xle1SnjY,3201
17
+ aigency/utils/logger.py,sha256=NYvEknt2BeSqn484ivaLFwP0KbAtBxDXFoJiiKiXKeI,3796
18
+ aigency/utils/singleton.py,sha256=u5stRwgwiXRt6b2vTX4W8zuchWvQ9kbcvztQDceaF3E,313
19
+ aigency/utils/utils.py,sha256=1eA-RxMZW6QIxhrK9TbxysxwKhGiJqjrvOk69xR-zKo,2698
20
+ aigency-0.0.1rc235167702.dist-info/METADATA,sha256=13Xlzj93-2hRUloYGv_e1pQZ9JraZ6nxDxx8LvlEpGg,7170
21
+ aigency-0.0.1rc235167702.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
+ aigency-0.0.1rc235167702.dist-info/top_level.txt,sha256=nr33Htucgjs3wJFNugPV8w7b9ZgSnytxCtRiinR3eb8,8
23
+ aigency-0.0.1rc235167702.dist-info/RECORD,,
aigency/models/config.py DELETED
@@ -1,69 +0,0 @@
1
- """Configuration models for agents."""
2
-
3
- from typing import List, Optional, Union
4
-
5
- from pydantic import BaseModel
6
-
7
- from aigency.models.core import Capabilities, ModelConfig, Skill
8
- from aigency.models.tools import FunctionTool, McpTool, Tool
9
-
10
- #class SecurityScheme(BaseModel):
11
- # """Define un esquema de seguridad individual."""
12
- # type: str
13
- # description: Optional[str] = None
14
- # scheme: str
15
- # bearerFormat: Optional[str] = None
16
- #
17
- #class AuthConfig(BaseModel):
18
- # """Configuración de autenticación."""
19
- # type: str
20
- # securitySchemes: Optional[Dict[str, SecurityScheme]] = None
21
- # security: Optional[List[Dict[str, List[str]]]] = None
22
-
23
- # --- Modelos para secciones opcionales ---
24
-
25
- #class MonitoringConfig(BaseModel):
26
- # """Configuración de monitorización y observabilidad."""
27
- # phoenix_host: Optional[str] = None
28
- # phoenix_port: Optional[int] = None
29
-
30
- #class RemoteAgent(BaseModel):
31
- # """Configuración para la comunicación con un agente remoto."""
32
- # name: str
33
- # host: str
34
- # port: int
35
- #auth: Optional[AuthConfig] = None # Reutilizamos la configuración de Auth
36
-
37
- # --- Clase Principal que une todo ---
38
-
39
- class AgentConfig(BaseModel):
40
- """Root Pydantic model for complete agent configuration."""
41
- # Configuración Básica
42
- name: str
43
- description: str
44
- url: str
45
- version: str
46
- default_input_modes: Optional[List[str]] = None
47
- default_output_modes: Optional[List[str]] = None
48
- capabilities: Optional[Capabilities] = None
49
-
50
- # Autenticación
51
- #auth: Optional[AuthConfig] = None
52
-
53
- # Configuración del Modelo
54
- model: ModelConfig
55
-
56
- # Comportamiento
57
- instruction: Optional[str] = None
58
- skills: Optional[List[Skill]] = None
59
-
60
- # Herramientas
61
- tools: Optional[List[Union[FunctionTool, McpTool, Tool]]] = None
62
-
63
- # Comunicación Multi-Agente
64
- #remote_agents_addresses: Optional[List[RemoteAgent]] = None
65
-
66
- # Monitorización
67
- #monitoring: Optional[MonitoringConfig] = None
68
-
69
-
aigency/models/core.py DELETED
@@ -1,28 +0,0 @@
1
- """Core models for agent configuration."""
2
-
3
- from typing import Dict, List, Optional
4
-
5
- from pydantic import BaseModel
6
-
7
-
8
- class ProviderConfig(BaseModel):
9
- """Configuration for AI model provider."""
10
- name: str
11
- endpoint: Optional[str] = None
12
-
13
- class ModelConfig(BaseModel):
14
- """Configuration for AI model."""
15
- name: str
16
- provider: Optional[ProviderConfig] = None
17
-
18
- class Capabilities(BaseModel):
19
- """Agent capabilities, such as streaming."""
20
- streaming: Optional[bool] = None
21
-
22
- class Skill(BaseModel):
23
- """Define a specific agent skill."""
24
- id: str
25
- name: str
26
- description: str
27
- tags: Optional[List[str]] = None
28
- examples: Optional[List[str]] = None
@@ -1,267 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: aigency
3
- Version: 0.0.1rc15474277
4
- Summary: Add your description here
5
- Requires-Python: >=3.12
6
- Description-Content-Type: text/markdown
7
- Requires-Dist: google-adk>=1.11.0
8
- Requires-Dist: a2a-sdk==0.3.0
9
- Requires-Dist: litellm<1.73.0,>=1.72.6
10
- Requires-Dist: pyyaml==6.0.2
11
- Requires-Dist: PyJWT==2.10.1
12
-
13
- # aigency-lib
14
-
15
- Una librería para crear y gestionar agentes de IA.
16
-
17
- ## Inicio rápido
18
-
19
- Para probar un agente simple:
20
-
21
- ```bash
22
- cd examples/simple_agents/hello_world_agent
23
- docker compose up
24
- ```
25
-
26
- ## 🔧 Gestión de versiones
27
-
28
- Este proyecto incluye un sistema automatizado para gestionar versiones tanto en desarrollo como en producción.
29
-
30
- ### Version Manager
31
-
32
- El script `scripts/version_manager.py` te ayuda a gestionar las versiones de tu paquete de forma local.
33
-
34
- #### Comandos disponibles
35
-
36
- ##### 1. Ver información actual
37
- ```bash
38
- python scripts/version_manager.py show
39
- ```
40
- **Qué hace:**
41
- - Muestra la versión actual en `pyproject.toml`
42
- - Muestra la rama git actual
43
- - Muestra el commit actual
44
- - Si no estás en `main`, sugiere una versión de desarrollo
45
-
46
- **Ejemplo de salida:**
47
- ```
48
- Versión actual: 0.0.1
49
- Rama: feature/new-agent
50
- Commit: a1b2c3d
51
- Versión dev sugerida: 0.0.1.dev20250409143022+feature/new-agent.a1b2c3d
52
- ```
53
-
54
- ##### 2. Crear versión de desarrollo
55
- ```bash
56
- python scripts/version_manager.py dev
57
- ```
58
- **Qué hace:**
59
- - Toma la versión actual y crea una versión de desarrollo
60
- - Formato: `version.devYYYYMMDDHHMMSS+branch.commit`
61
- - Actualiza automáticamente el `pyproject.toml`
62
-
63
- **Ejemplo:**
64
- ```bash
65
- # Si estás en rama "feature/auth" con commit "abc123"
66
- python scripts/version_manager.py dev
67
- # Resultado: 0.0.1.dev20250409143022
68
- ```
69
-
70
- ##### 3. Establecer versión específica
71
- ```bash
72
- python scripts/version_manager.py set --version "0.1.0"
73
- ```
74
- **Qué hace:**
75
- - Cambia la versión a la que especifiques
76
- - Útil para releases o para corregir versiones
77
-
78
- **Ejemplos:**
79
- ```bash
80
- # Versión de release
81
- python scripts/version_manager.py set --version "1.0.0"
82
-
83
- # Versión beta
84
- python scripts/version_manager.py set --version "1.0.0b1"
85
-
86
- # Versión alpha
87
- python scripts/version_manager.py set --version "1.0.0a1"
88
- ```
89
-
90
- ##### 4. Crear versión Release Candidate
91
- ```bash
92
- python scripts/version_manager.py rc --version "1.0.1"
93
- ```
94
- **Qué hace:**
95
- - Crea una versión RC con el formato `version-rc<commit>`
96
- - Útil para preparar releases en ramas `release/*`
97
-
98
- ##### 5. Validar versión actual
99
- ```bash
100
- python scripts/version_manager.py validate
101
- ```
102
- **Qué hace:**
103
- - Valida que la versión actual sea apropiada para la rama
104
- - Verifica formato semántico en `main` y ramas `release/*`
105
-
106
- ##### 6. Crear dev con versión base personalizada
107
- ```bash
108
- python scripts/version_manager.py dev --base-version "0.2.0"
109
- ```
110
- **Qué hace:**
111
- - Usa una versión base diferente a la actual
112
- - Útil cuando quieres preparar una dev version para la próxima release
113
-
114
- ### 🚀 Flujo de trabajo recomendado
115
-
116
- #### Para desarrollo diario:
117
- ```bash
118
- # 1. Ver estado actual
119
- python scripts/version_manager.py show
120
-
121
- # 2. Si estás en una rama feature, crear versión dev
122
- python scripts/version_manager.py dev
123
-
124
- # 3. Hacer tus cambios y commits
125
- git add .
126
- git commit -m "feat: nueva funcionalidad"
127
-
128
- # 4. Si necesitas actualizar la versión dev (opcional)
129
- python scripts/version_manager.py dev
130
- ```
131
-
132
- #### Para releases:
133
- ```bash
134
- # 1. En rama main, establecer versión de release
135
- python scripts/version_manager.py set --version "1.0.0"
136
-
137
- # 2. Commit de la versión
138
- git add pyproject.toml
139
- git commit -m "bump: version 1.0.0"
140
-
141
- # 3. Usar el workflow de GitHub para publicar
142
- ```
143
-
144
- #### Para testing:
145
- ```bash
146
- # Crear versión de test específica
147
- python scripts/version_manager.py set --version "1.0.0rc1"
148
- ```
149
-
150
- ### ⚠️ Limitaciones de PyPI
151
-
152
- PyPI no permite "local versions" (versiones con `+` y identificadores locales). Por eso, hemos adaptado el formato:
153
-
154
- - ❌ No permitido: `1.0.0.dev20250409+feature.abc123`
155
- - ✅ Permitido: `1.0.0.dev20250409`
156
-
157
- **Solución para Release Candidates:**
158
- - Convertimos el hash del commit (hexadecimal) a decimal
159
- - Ejemplo: commit `abc123` → `11256099` → versión `1.0.1rc11256099`
160
- - Esto mantiene la unicidad del commit en un formato compatible con PyPI
161
-
162
- **Resultado:**
163
- - Las versiones dev incluyen timestamp único
164
- - Las versiones RC incluyen el hash del commit (en decimal)
165
- - Mantenemos trazabilidad sin usar local versions
166
-
167
- ### 📋 Casos de uso prácticos
168
-
169
- **Escenario 1: Trabajando en una feature**
170
- ```bash
171
- git checkout -b feature/new-auth
172
- python scripts/version_manager.py dev
173
- # Ahora tienes: 0.0.1.dev20250409143022
174
- ```
175
-
176
- **Escenario 2: Preparando release**
177
- ```bash
178
- git checkout main
179
- python scripts/version_manager.py set --version "1.0.0"
180
- git add pyproject.toml
181
- git commit -m "release: v1.0.0"
182
- ```
183
-
184
- **Escenario 3: Preparando Release Candidate**
185
- ```bash
186
- git checkout -b release/1.0.1
187
- python scripts/version_manager.py rc --version "1.0.1"
188
- # Resultado: 1.0.1rc12345678 (donde 12345678 es el hash del commit en decimal)
189
- ```
190
-
191
- **Escenario 4: Hotfix urgente**
192
- ```bash
193
- git checkout -b hotfix/critical-bug
194
- python scripts/version_manager.py dev --base-version "1.0.1"
195
- # Resultado: 1.0.1.dev20250409143022
196
- ```
197
-
198
- ## 🔄 Workflow de CI/CD Inteligente
199
-
200
- El proyecto incluye un único workflow inteligente (`python-publish.yml`) que maneja automáticamente diferentes tipos de versiones según la rama:
201
-
202
- ### Comportamiento automático por rama:
203
-
204
- #### 🚀 Rama `main` - Versiones de Producción
205
- - **Trigger**: Push a `main` o ejecución manual
206
- - **Versión**: Usa exactamente la versión del `pyproject.toml`
207
- - **Validaciones**:
208
- - ✅ Verifica que sea una versión semántica válida (ej: `1.0.0`)
209
- - ✅ Verifica que no exista ya en PyPI
210
- - ❌ Falla si contiene sufijos de desarrollo (`dev`, `rc`, `alpha`, `beta`)
211
- - **Destino**: PyPI producción
212
-
213
- #### 🎯 Ramas `release/*` - Release Candidates
214
- - **Trigger**: Push a rama `release/X.Y.Z` o ejecución manual
215
- - **Versión**: `X.Y.ZrcN` donde N es el hash del commit en decimal (ej: `1.0.1rc12345678`)
216
- - **Validaciones**:
217
- - ✅ Verifica que `X.Y.Z` sea una versión semántica válida
218
- - ✅ Extrae la versión del nombre de la rama
219
- - ✅ Usa hash del commit como identificador único
220
- - ✅ Formato compatible con PyPI
221
- - **Destino**: PyPI producción
222
- - **Ejemplo**: Rama `release/1.0.1` + commit `abc123` → Versión `1.0.1rc11256099`
223
-
224
- #### 🔧 Otras ramas - Versiones de Desarrollo
225
- - **Trigger**: Push a cualquier otra rama o ejecución manual
226
- - **Versión**: `current.devYYYYMMDDHHMMSS` (ej: `0.0.1.dev20250409143022`)
227
- - **Destino**: PyPI producción
228
- - **Nota**: Sin local versions para compatibilidad con PyPI
229
-
230
- ### Flujo de trabajo recomendado:
231
-
232
- ```bash
233
- # 1. Desarrollo en feature branch
234
- git checkout -b feature/new-functionality
235
- # Versión automática: 0.0.1.dev20250409143022+feature-new-functionality.abc123
236
-
237
- # 2. Preparar release
238
- git checkout -b release/1.0.0
239
- git push origin release/1.0.0
240
- # Versión automática: 1.0.0rc12345678
241
-
242
- # 3. Release final
243
- git checkout main
244
- python scripts/version_manager.py set --version "1.0.0"
245
- git add pyproject.toml
246
- git commit -m "release: v1.0.0"
247
- git push origin main
248
- # Versión: 1.0.0 (con validaciones)
249
- ```
250
-
251
- ## 📦 Instalación
252
-
253
- ```bash
254
- pip install aigency
255
- ```
256
-
257
- ## 🛠️ Desarrollo
258
-
259
- 1. Clona el repositorio
260
- 2. Instala las dependencias de desarrollo
261
- 3. Usa el version manager para gestionar versiones durante el desarrollo
262
-
263
- ```bash
264
- git clone <repo-url>
265
- cd aigency-lib
266
- pip install -e .
267
- ```
@@ -1,15 +0,0 @@
1
- aigency/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- aigency/agents/executor.py,sha256=ozT0wMwHLfyHi7bLcIPvs1gqnuj8w33SzlsSLB0W55k,5276
3
- aigency/agents/generator.py,sha256=8RzhUgcw99Wt7p0LIaQKXitx2wpuVgeg8XTsEWZ3fjM,2359
4
- aigency/models/config.py,sha256=c6dGPkn9AQ8x_vF-dNd509q-AOFJ1VFGPQtipCKz4Bs,1992
5
- aigency/models/core.py,sha256=Y6FSlv7KGVr7H-WbT0wYY_bf7LeywcCjfXWlIVa1CIk,684
6
- aigency/models/tools.py,sha256=VXdA0cKptAzu-4Oa0McxoI7uZtpsGXjXfAxUKzv2f4E,885
7
- aigency/tools/generator.py,sha256=2TNbQAHDsZF2nt63X0k8GnxTFMUYwA110Irxq4BYmfw,2511
8
- aigency/utils/config_service.py,sha256=ql2NsQBjhwH6phbsbqp698je1NmAUlZuyXOE0Bb9LWM,2921
9
- aigency/utils/logger.py,sha256=NYvEknt2BeSqn484ivaLFwP0KbAtBxDXFoJiiKiXKeI,3796
10
- aigency/utils/singleton.py,sha256=u5stRwgwiXRt6b2vTX4W8zuchWvQ9kbcvztQDceaF3E,313
11
- aigency/utils/utils.py,sha256=1eA-RxMZW6QIxhrK9TbxysxwKhGiJqjrvOk69xR-zKo,2698
12
- aigency-0.0.1rc15474277.dist-info/METADATA,sha256=zflUAom3vGz7ScCKBi9zFHW3GagZkUhwREX-T8iqXt8,7397
13
- aigency-0.0.1rc15474277.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- aigency-0.0.1rc15474277.dist-info/top_level.txt,sha256=nr33Htucgjs3wJFNugPV8w7b9ZgSnytxCtRiinR3eb8,8
15
- aigency-0.0.1rc15474277.dist-info/RECORD,,
File without changes