process-gpt-agent-sdk 0.4.8__tar.gz → 0.4.9__tar.gz

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 process-gpt-agent-sdk might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: process-gpt-agent-sdk
3
- Version: 0.4.8
3
+ Version: 0.4.9
4
4
  Summary: Supabase 기반 이벤트/작업 폴링으로 A2A AgentExecutor를 실행하는 SDK
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://github.com/your-org/process-gpt-agent-sdk
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: process-gpt-agent-sdk
3
- Version: 0.4.8
3
+ Version: 0.4.9
4
4
  Summary: Supabase 기반 이벤트/작업 폴링으로 A2A AgentExecutor를 실행하는 SDK
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://github.com/your-org/process-gpt-agent-sdk
@@ -322,38 +322,87 @@ class ProcessGPTEventQueue(EventQueue):
322
322
  raise
323
323
 
324
324
  def _extract_payload(self, event: Event) -> Any:
325
- artifact_or_none = getattr(event, "artifact", None)
326
- status_or_none = getattr(event, "status", None)
327
- message_or_none = getattr(status_or_none, "message", None)
328
- source = artifact_or_none if artifact_or_none is not None else message_or_none
329
- return self._parse_json_or_text(source)
325
+ try:
326
+ logger.info("🔧 [이벤트 페이로드 추출 시작] event_type: %s", type(event).__name__)
327
+ artifact_or_none = getattr(event, "artifact", None)
328
+ status_or_none = getattr(event, "status", None)
329
+ message_or_none = getattr(status_or_none, "message", None) if status_or_none else None
330
+
331
+ logger.info("🔧 [이벤트 페이로드] artifact: %s", artifact_or_none)
332
+ logger.info("🔧 [이벤트 페이로드] status: %s", status_or_none)
333
+ logger.info("🔧 [이벤트 페이로드] message: %s", message_or_none)
334
+
335
+ source = artifact_or_none if artifact_or_none is not None else message_or_none
336
+ logger.info("🔧 [이벤트 페이로드] source: %s (type: %s)", source, type(source).__name__)
337
+
338
+ result = self._parse_json_or_text(source)
339
+ logger.info("🔧 [이벤트 페이로드] 파싱 결과: %s (type: %s)", result, type(result).__name__)
340
+ return result
341
+ except Exception as e:
342
+ logger.error("❌ [이벤트 페이로드 추출 실패] %s", str(e), exc_info=e)
343
+ return {}
330
344
 
331
345
  def _parse_json_or_text(self, value: Any) -> Any:
346
+ logger.info("🔧 [JSON 파싱 시작] value: %s (type: %s)", value, type(value).__name__)
347
+
332
348
  if value is None:
349
+ logger.info("🔧 [JSON 파싱] None 값 -> 빈 객체 반환")
333
350
  return {}
351
+
334
352
  if isinstance(value, str):
335
353
  text = value.strip()
354
+ logger.info("🔧 [JSON 파싱] 문자열 처리 - text: '%s' (길이: %d)", text, len(text))
336
355
  if not text:
356
+ logger.info("🔧 [JSON 파싱] 빈 문자열 -> 빈 문자열 반환")
337
357
  return ""
338
- return json.loads(text)
358
+ try:
359
+ result = json.loads(text)
360
+ logger.info("🔧 [JSON 파싱] JSON 파싱 성공: %s", result)
361
+ return result
362
+ except json.JSONDecodeError as e:
363
+ logger.error("❌ [JSON 파싱] JSON 파싱 실패: %s - 원본 텍스트: '%s'", str(e), text)
364
+ return text
339
365
  if hasattr(value, "model_dump") and callable(getattr(value, "model_dump")):
366
+ logger.info("🔧 [JSON 파싱] model_dump() 호출")
340
367
  value = value.model_dump()
341
368
  elif not isinstance(value, dict) and hasattr(value, "dict") and callable(getattr(value, "dict")):
369
+ logger.info("🔧 [JSON 파싱] dict() 호출")
342
370
  value = value.dict()
343
371
  elif not isinstance(value, dict) and hasattr(value, "__dict__"):
372
+ logger.info("🔧 [JSON 파싱] __dict__ 사용")
344
373
  value = value.__dict__
374
+
345
375
  if isinstance(value, dict):
376
+ logger.info("🔧 [JSON 파싱] 딕셔너리 처리 시작")
346
377
  parts = value.get("parts")
347
378
  if isinstance(parts, list) and parts:
379
+ logger.info("🔧 [JSON 파싱] parts 배열 처리 - parts: %s", parts)
348
380
  first = parts[0] if isinstance(parts[0], dict) else None
349
381
  if first and isinstance(first, dict):
350
382
  txt = first.get("text") or first.get("content") or first.get("data")
383
+ logger.info("🔧 [JSON 파싱] parts[0]에서 텍스트 추출: %s", txt)
351
384
  if isinstance(txt, str):
352
- return json.loads(txt)
385
+ try:
386
+ result = json.loads(txt)
387
+ logger.info("🔧 [JSON 파싱] parts 텍스트 JSON 파싱 성공: %s", result)
388
+ return result
389
+ except Exception as e:
390
+ logger.error("❌ [JSON 파싱] parts 텍스트 JSON 파싱 실패: %s", str(e))
391
+ return txt
353
392
  top_text = value.get("text") or value.get("content") or value.get("data")
393
+ logger.info("🔧 [JSON 파싱] 최상위 텍스트 추출: %s", top_text)
354
394
  if isinstance(top_text, str):
355
- return json.loads(top_text)
395
+ try:
396
+ result = json.loads(top_text)
397
+ logger.info("🔧 [JSON 파싱] 최상위 텍스트 JSON 파싱 성공: %s", result)
398
+ return result
399
+ except Exception as e:
400
+ logger.error("❌ [JSON 파싱] 최상위 텍스트 JSON 파싱 실패: %s", str(e))
401
+ return top_text
402
+ logger.info("🔧 [JSON 파싱] 딕셔너리 그대로 반환: %s", value)
356
403
  return value
404
+
405
+ logger.info("🔧 [JSON 파싱] 기타 타입 그대로 반환: %s", value)
357
406
  return value
358
407
 
359
408
  def task_done(self) -> None:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "process-gpt-agent-sdk"
7
- version = "0.4.8"
7
+ version = "0.4.9"
8
8
  description = "Supabase 기반 이벤트/작업 폴링으로 A2A AgentExecutor를 실행하는 SDK"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"