aiecs 1.4.1__py3-none-any.whl → 1.4.3__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.

Potentially problematic release.


This version of aiecs might be problematic. Click here for more details.

aiecs/__init__.py CHANGED
@@ -5,7 +5,7 @@ A powerful Python middleware framework for building AI-powered applications
5
5
  with tool orchestration, task execution, and multi-provider LLM support.
6
6
  """
7
7
 
8
- __version__ = "1.4.1"
8
+ __version__ = "1.4.3"
9
9
  __author__ = "AIECS Team"
10
10
  __email__ = "iretbl@gmail.com"
11
11
 
@@ -133,7 +133,14 @@ class FileStorage:
133
133
  if self.config.gcs_credentials_path:
134
134
  os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = self.config.gcs_credentials_path
135
135
 
136
- # Create client
136
+ # Create client - project is required for bucket creation
137
+ # If project_id is None, client will use default project from credentials
138
+ # but we need it for bucket creation API calls
139
+ if not self.config.gcs_project_id:
140
+ logger.warning("GCS project ID not provided. Bucket creation will be disabled.")
141
+ logger.warning("Bucket must exist and be accessible. Falling back to local storage if bucket not found.")
142
+
143
+ # Create client with project ID (can be None, but bucket creation will fail)
137
144
  self._gcs_client = storage.Client(project=self.config.gcs_project_id)
138
145
 
139
146
  # Get or create bucket
@@ -144,12 +151,28 @@ class FileStorage:
144
151
  logger.info(f"Connected to GCS bucket: {self.config.gcs_bucket_name}")
145
152
 
146
153
  except NotFound:
147
- # Create bucket if it doesn't exist
148
- self._gcs_bucket = self._gcs_client.create_bucket(
149
- self.config.gcs_bucket_name,
150
- location=self.config.gcs_location
151
- )
152
- logger.info(f"Created GCS bucket: {self.config.gcs_bucket_name}")
154
+ # Only create bucket if project_id is provided
155
+ # Bucket creation requires project parameter in API call
156
+ if self.config.gcs_project_id:
157
+ try:
158
+ self._gcs_bucket = self._gcs_client.create_bucket(
159
+ self.config.gcs_bucket_name,
160
+ project=self.config.gcs_project_id, # Explicitly pass project parameter
161
+ location=self.config.gcs_location
162
+ )
163
+ logger.info(f"Created GCS bucket: {self.config.gcs_bucket_name} in project {self.config.gcs_project_id}")
164
+ except Exception as create_error:
165
+ logger.error(f"Failed to create GCS bucket {self.config.gcs_bucket_name}: {create_error}")
166
+ logger.warning("Bucket creation failed. Will use local storage fallback.")
167
+ self._gcs_bucket = None
168
+ else:
169
+ logger.error(
170
+ f"GCS bucket '{self.config.gcs_bucket_name}' not found and "
171
+ "project ID is not provided. Cannot create bucket without project parameter."
172
+ )
173
+ logger.warning("Please ensure the bucket exists or provide DOC_PARSER_GCS_PROJECT_ID in configuration.")
174
+ logger.warning("Falling back to local storage only.")
175
+ self._gcs_bucket = None
153
176
 
154
177
  except DefaultCredentialsError:
155
178
  logger.warning("GCS credentials not found, using local storage only")
aiecs/main.py CHANGED
@@ -142,7 +142,7 @@ async def lifespan(app: FastAPI):
142
142
  app = FastAPI(
143
143
  title="AIECS - AI Execute Services",
144
144
  description="Middleware service for AI-powered task execution and tool orchestration",
145
- version="1.4.1",
145
+ version="1.4.3",
146
146
  lifespan=lifespan
147
147
  )
148
148
 
@@ -167,7 +167,7 @@ async def health_check():
167
167
  return {
168
168
  "status": "healthy",
169
169
  "service": "aiecs",
170
- "version": "1.4.1"
170
+ "version": "1.4.3"
171
171
  }
172
172
 
173
173
 
@@ -88,7 +88,11 @@ class DocumentParserTool(BaseTool):
88
88
 
89
89
  # Configuration schema
90
90
  class Config(BaseModel):
91
- """Configuration for the document parser tool"""
91
+ """Configuration for the document parser tool
92
+
93
+ Automatically reads from environment variables with DOC_PARSER_ prefix.
94
+ Example: DOC_PARSER_GCS_PROJECT_ID -> gcs_project_id
95
+ """
92
96
  model_config = ConfigDict(env_prefix="DOC_PARSER_")
93
97
 
94
98
  user_agent: str = Field(
@@ -133,7 +137,15 @@ class DocumentParserTool(BaseTool):
133
137
  super().__init__(config)
134
138
 
135
139
  # Parse configuration
136
- self.config = self.Config(**(config or {}))
140
+ # If config is None or empty, let Pydantic read from environment variables
141
+ # This ensures that get_tool() can properly load config from .env files
142
+ if config:
143
+ # Filter out None values to allow env vars to be used for missing keys
144
+ filtered_config = {k: v for k, v in config.items() if v is not None}
145
+ self.config = self.Config(**filtered_config)
146
+ else:
147
+ # No config provided, read entirely from environment variables
148
+ self.config = self.Config()
137
149
 
138
150
  self.logger = logging.getLogger(__name__)
139
151
  os.makedirs(self.config.temp_dir, exist_ok=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiecs
3
- Version: 1.4.1
3
+ Version: 1.4.3
4
4
  Summary: AI Execute Services - A middleware framework for AI-powered task execution and tool orchestration
5
5
  Author-email: AIECS Team <iretbl@gmail.com>
6
6
  License-Expression: MIT
@@ -1,7 +1,7 @@
1
- aiecs/__init__.py,sha256=fb_uYsyBbfL6G4E9tKCaZMLPHQBDUQ-FScTNFgWBrt4,1859
1
+ aiecs/__init__.py,sha256=uLMpkNoSLQ3nUguXQnVSj98iI9d0TDLsOffjvhB1CRE,1859
2
2
  aiecs/__main__.py,sha256=AfQpzy3SgwWuP4DuymYcm4MISMuzqwhxxGSYo53PBvY,1035
3
3
  aiecs/aiecs_client.py,sha256=gIqecRBBH_bYIWhqiHCemdVgmGb9Jqdxf1b6RoqXWlQ,17276
4
- aiecs/main.py,sha256=F5oXIOnmwULnfCWk7X7fej3q-W4gFrjVhLaMPFw4Dpk,10837
4
+ aiecs/main.py,sha256=4wb6vcdHJTdaLqO3Z10yKBMhpqmFmAVnfpaJpWCsIHc,10837
5
5
  aiecs/application/__init__.py,sha256=NkmrUH1DqxJ3vaVC8QwscNdlWqHfC7ZagL4k3nZ_qz4,192
6
6
  aiecs/application/executors/__init__.py,sha256=WIl7L9HBsEhNfbNtJdvBvFUJXzESvNZVaiAA6tdtJcs,191
7
7
  aiecs/application/executors/operation_executor.py,sha256=-7mFo1hUnWdehVPg0fnSiRhW3LACpIiyLSH-iu7bX4U,13818
@@ -75,7 +75,7 @@ aiecs/infrastructure/monitoring/tracing_manager.py,sha256=g4u6paNCZCYdGDEMZiv4bY
75
75
  aiecs/infrastructure/persistence/__init__.py,sha256=yoog7fEHmhgY50vGdgDNqiZCPUUL2-xnJrdhT5PrPWU,570
76
76
  aiecs/infrastructure/persistence/context_engine_client.py,sha256=KIzreimtg6WbuBYI4U0JTiRmNddpdpKHnGvuHVh86Hs,6051
77
77
  aiecs/infrastructure/persistence/database_manager.py,sha256=MRkMTALeeybzAfnfuJrOXbEchBCrMAgsz8YYyEUVMjI,12592
78
- aiecs/infrastructure/persistence/file_storage.py,sha256=Z8EozljYPBUuBTzDn2cM2uBEPp2uUW_eHLzwNxbKcOk,23889
78
+ aiecs/infrastructure/persistence/file_storage.py,sha256=ZeyQ5KciMbfxvkrHpuJ7wUjh2uOS2qASngy5q_2QJKU,25605
79
79
  aiecs/infrastructure/persistence/redis_client.py,sha256=ZwGvyiRrsFfC0N8-AGxTOh3FJuHXjt1Y1xjLZE8tKHg,7431
80
80
  aiecs/llm/__init__.py,sha256=QlpjRn6WK5rCC0Aswx4AeFmSAIxJQ0XyxjimrIee7jE,1860
81
81
  aiecs/llm/client_factory.py,sha256=534lVM4JplAFT-4tMHl4ebN9T9Cfz8WTyJjBGA9ly2s,14383
@@ -150,7 +150,7 @@ aiecs/tools/docs/ai_document_writer_orchestrator.py,sha256=Q2P4313JQYOYjpBchQMKo
150
150
  aiecs/tools/docs/content_insertion_tool.py,sha256=iQvNDnmA4XBg7RT8o04vqhc-cZmZ_bsfYMFe9ankHZY,49351
151
151
  aiecs/tools/docs/document_creator_tool.py,sha256=QLHKEBvZjtDSgaT1a0a7SrjbPlfSJyVfKYX8u_x2smg,39413
152
152
  aiecs/tools/docs/document_layout_tool.py,sha256=L5ZyFyShNX6FW1e374m21ZpvNs8eZsmj8l85LFRq2xo,45234
153
- aiecs/tools/docs/document_parser_tool.py,sha256=TuECotyEh9lirZ2L3-lixBTTvhJtJpNTt188z8GIejw,38366
153
+ aiecs/tools/docs/document_parser_tool.py,sha256=nuHiDCHPu5laWb8UlS00CkEG7VlaIWNgaSZwiRFWfLE,39005
154
154
  aiecs/tools/docs/document_writer_tool.py,sha256=BPfBiv2D9NSdjDD_ByFTfiYTqTSexSNWBmj_gfLpA9c,69061
155
155
  aiecs/tools/search_tool/__init__.py,sha256=tn2vBakmr2tExbUtfiCjhUL_KVqkhZFEHU-t6XbG9hw,2664
156
156
  aiecs/tools/search_tool/analyzers.py,sha256=d34NT5PKNamOJtVyGkmjD3Tk3EE32vSzM-gWSw8VO9s,21266
@@ -195,9 +195,9 @@ aiecs/utils/prompt_loader.py,sha256=cBS2bZXpYQOWSiOGkhwIzyy3_bETqwIblRi_9qQT9iQ,
195
195
  aiecs/utils/token_usage_repository.py,sha256=1xjenLYwC0YT6lKZFEGO4scRCXLuWdec2MWjzih5SZY,10210
196
196
  aiecs/ws/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
197
197
  aiecs/ws/socket_server.py,sha256=j_9idVY_rWlTsF51FgmuhWCWFVt7_gAHL8vNg3IxV5g,1476
198
- aiecs-1.4.1.dist-info/licenses/LICENSE,sha256=_1YRaIS0eZu1pv6xfz245UkU0i1Va2B841hv3OWRwqg,12494
199
- aiecs-1.4.1.dist-info/METADATA,sha256=4sbX5_awoM0Sa46qPgBbmmg7qntdzTeM4ROSHyFAyfg,16635
200
- aiecs-1.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
201
- aiecs-1.4.1.dist-info/entry_points.txt,sha256=TfLBuwLOfgQqKvnoF1sgTS19-Hgl0aWvCZjIdblIiig,667
202
- aiecs-1.4.1.dist-info/top_level.txt,sha256=22IlUlOqh9Ni3jXlQNMNUqzbW8dcxXPeR_EQ-BJVcV8,6
203
- aiecs-1.4.1.dist-info/RECORD,,
198
+ aiecs-1.4.3.dist-info/licenses/LICENSE,sha256=_1YRaIS0eZu1pv6xfz245UkU0i1Va2B841hv3OWRwqg,12494
199
+ aiecs-1.4.3.dist-info/METADATA,sha256=aws104iKIrRPy8Lh3chFnBzMHQz9ZuqdC-vVavGLgqM,16635
200
+ aiecs-1.4.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
201
+ aiecs-1.4.3.dist-info/entry_points.txt,sha256=TfLBuwLOfgQqKvnoF1sgTS19-Hgl0aWvCZjIdblIiig,667
202
+ aiecs-1.4.3.dist-info/top_level.txt,sha256=22IlUlOqh9Ni3jXlQNMNUqzbW8dcxXPeR_EQ-BJVcV8,6
203
+ aiecs-1.4.3.dist-info/RECORD,,
File without changes