process-gpt-agent-sdk 0.4.7__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.7
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.7
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
@@ -139,7 +139,10 @@ class ProcessGPTRequestContext(RequestContext):
139
139
  for u in users[:5]:
140
140
  name = u.get("name", u.get("username", "Unknown"))
141
141
  email = u.get("email", "")
142
- user_info.append(f"{name}({email})" if email else name)
142
+ user_str = f"{name}({email})" if email else name
143
+ # None 값 제거
144
+ if user_str and user_str != "None":
145
+ user_info.append(user_str)
143
146
  logger.info("🔧 [Users 정보] user_info 리스트: %s", user_info)
144
147
  logger.info("• Users (%d명): %s%s", len(users), ", ".join(user_info), "..." if len(users) > 5 else "")
145
148
  else:
@@ -154,7 +157,10 @@ class ProcessGPTRequestContext(RequestContext):
154
157
  name = a.get("name", a.get("username", "Unknown"))
155
158
  tools = a.get("tools", "")
156
159
  tool_str = f"[{tools}]" if tools else ""
157
- agent_info.append(f"{name}{tool_str}")
160
+ agent_str = f"{name}{tool_str}"
161
+ # None 값 제거
162
+ if agent_str and agent_str != "None":
163
+ agent_info.append(agent_str)
158
164
  logger.info("🔧 [Agents 정보] agent_info 리스트: %s", agent_info)
159
165
  logger.info("• Agents (%d개): %s%s", len(agents), ", ".join(agent_info), "..." if len(agents) > 5 else "")
160
166
  else:
@@ -316,38 +322,87 @@ class ProcessGPTEventQueue(EventQueue):
316
322
  raise
317
323
 
318
324
  def _extract_payload(self, event: Event) -> Any:
319
- artifact_or_none = getattr(event, "artifact", None)
320
- status_or_none = getattr(event, "status", None)
321
- message_or_none = getattr(status_or_none, "message", None)
322
- source = artifact_or_none if artifact_or_none is not None else message_or_none
323
- 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 {}
324
344
 
325
345
  def _parse_json_or_text(self, value: Any) -> Any:
346
+ logger.info("🔧 [JSON 파싱 시작] value: %s (type: %s)", value, type(value).__name__)
347
+
326
348
  if value is None:
349
+ logger.info("🔧 [JSON 파싱] None 값 -> 빈 객체 반환")
327
350
  return {}
351
+
328
352
  if isinstance(value, str):
329
353
  text = value.strip()
354
+ logger.info("🔧 [JSON 파싱] 문자열 처리 - text: '%s' (길이: %d)", text, len(text))
330
355
  if not text:
356
+ logger.info("🔧 [JSON 파싱] 빈 문자열 -> 빈 문자열 반환")
331
357
  return ""
332
- 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
333
365
  if hasattr(value, "model_dump") and callable(getattr(value, "model_dump")):
366
+ logger.info("🔧 [JSON 파싱] model_dump() 호출")
334
367
  value = value.model_dump()
335
368
  elif not isinstance(value, dict) and hasattr(value, "dict") and callable(getattr(value, "dict")):
369
+ logger.info("🔧 [JSON 파싱] dict() 호출")
336
370
  value = value.dict()
337
371
  elif not isinstance(value, dict) and hasattr(value, "__dict__"):
372
+ logger.info("🔧 [JSON 파싱] __dict__ 사용")
338
373
  value = value.__dict__
374
+
339
375
  if isinstance(value, dict):
376
+ logger.info("🔧 [JSON 파싱] 딕셔너리 처리 시작")
340
377
  parts = value.get("parts")
341
378
  if isinstance(parts, list) and parts:
379
+ logger.info("🔧 [JSON 파싱] parts 배열 처리 - parts: %s", parts)
342
380
  first = parts[0] if isinstance(parts[0], dict) else None
343
381
  if first and isinstance(first, dict):
344
382
  txt = first.get("text") or first.get("content") or first.get("data")
383
+ logger.info("🔧 [JSON 파싱] parts[0]에서 텍스트 추출: %s", txt)
345
384
  if isinstance(txt, str):
346
- 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
347
392
  top_text = value.get("text") or value.get("content") or value.get("data")
393
+ logger.info("🔧 [JSON 파싱] 최상위 텍스트 추출: %s", top_text)
348
394
  if isinstance(top_text, str):
349
- 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)
350
403
  return value
404
+
405
+ logger.info("🔧 [JSON 파싱] 기타 타입 그대로 반환: %s", value)
351
406
  return value
352
407
 
353
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.7"
7
+ version = "0.4.9"
8
8
  description = "Supabase 기반 이벤트/작업 폴링으로 A2A AgentExecutor를 실행하는 SDK"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"