fastsdk 0.4.3__tar.gz → 0.4.4__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.
Files changed (55) hide show
  1. {fastsdk-0.4.3 → fastsdk-0.4.4}/PKG-INFO +1 -1
  2. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/request/api_client_socaity.py +18 -5
  3. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk.egg-info/PKG-INFO +1 -1
  4. {fastsdk-0.4.3 → fastsdk-0.4.4}/pyproject.toml +1 -1
  5. {fastsdk-0.4.3 → fastsdk-0.4.4}/LICENSE +0 -0
  6. {fastsdk-0.4.3 → fastsdk-0.4.4}/README.md +0 -0
  7. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/__init__.py +0 -0
  8. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/api.py +0 -0
  9. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/cli.py +0 -0
  10. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/fastClient.py +0 -0
  11. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/fastSDK.py +0 -0
  12. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/fastStub.py +0 -0
  13. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/requires.py +0 -0
  14. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/sdk_factory/__init__.py +0 -0
  15. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/sdk_factory/sdk_factory.py +0 -0
  16. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/sdk_factory/sdk_template.j2 +0 -0
  17. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_access.py +0 -0
  18. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/__init__.py +0 -0
  19. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/api_job_manager.py +0 -0
  20. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/api_seex.py +0 -0
  21. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/async_bridge.py +0 -0
  22. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/job_runtime.py +0 -0
  23. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/job_tasks.py +0 -0
  24. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/pipeline_planner.py +0 -0
  25. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/provider_factory.py +0 -0
  26. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/provider_stack_registry.py +0 -0
  27. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/request/__init__.py +0 -0
  28. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/request/api_client.py +0 -0
  29. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/request/api_client_replicate.py +0 -0
  30. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/request/api_client_runpod.py +0 -0
  31. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/request/file_handler.py +0 -0
  32. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/response/api_job_status.py +0 -0
  33. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/response/response_parser.py +0 -0
  34. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/response/response_schemas.py +0 -0
  35. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/response/sse_assembly.py +0 -0
  36. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_interaction/response/stream_session.py +0 -0
  37. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_specification_loader/replicate_loader.py +0 -0
  38. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_specification_loader/runpod_open_api_loader.py +0 -0
  39. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk/service_specification_loader/spec_loader.py +0 -0
  40. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk.egg-info/SOURCES.txt +0 -0
  41. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk.egg-info/dependency_links.txt +0 -0
  42. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk.egg-info/entry_points.txt +0 -0
  43. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk.egg-info/requires.txt +0 -0
  44. {fastsdk-0.4.3 → fastsdk-0.4.4}/fastsdk.egg-info/top_level.txt +0 -0
  45. {fastsdk-0.4.3 → fastsdk-0.4.4}/setup.cfg +0 -0
  46. {fastsdk-0.4.3 → fastsdk-0.4.4}/test/test_apipod_debug_test_services.py +0 -0
  47. {fastsdk-0.4.3 → fastsdk-0.4.4}/test/test_apipod_registry_service_management_example.py +0 -0
  48. {fastsdk-0.4.3 → fastsdk-0.4.4}/test/test_client_factory.py +0 -0
  49. {fastsdk-0.4.3 → fastsdk-0.4.4}/test/test_client_factory_manual.py +0 -0
  50. {fastsdk-0.4.3 → fastsdk-0.4.4}/test/test_client_from_fastapi.py +0 -0
  51. {fastsdk-0.4.3 → fastsdk-0.4.4}/test/test_client_from_runpod_serverless.py +0 -0
  52. {fastsdk-0.4.3 → fastsdk-0.4.4}/test/test_httpx_api.py +0 -0
  53. {fastsdk-0.4.3 → fastsdk-0.4.4}/test/test_localhost_services.py +0 -0
  54. {fastsdk-0.4.3 → fastsdk-0.4.4}/test/test_manual_sdk.py +0 -0
  55. {fastsdk-0.4.3 → fastsdk-0.4.4}/test/test_replicate.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastsdk
3
- Version: 0.4.3
3
+ Version: 0.4.4
4
4
  Summary: Turn any AI/web service (OpenAPI, Replicate, RunPod, APIPod) into a native-feeling Python client.
5
5
  Author: SocAIty
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -71,14 +71,27 @@ class APIClientSocaity(APIClient):
71
71
 
72
72
  endpoint = self._endpoint_for_url(request_data.url)
73
73
  content_type = getattr(endpoint, "request_body_content_type", None) if endpoint else None
74
+ # Registered chat/LLM schemas must stay JSON even when a legacy contract
75
+ # advertised form/urlencoded (flattened messages would be stringified).
76
+ standard_schema = getattr(endpoint, "standard_schema", None) if endpoint else None
77
+ body = {k: v for k, v in request_data.body_params.items() if v is not None}
78
+ has_nested = any(isinstance(v, (dict, list)) for v in body.values())
79
+ use_json = (
80
+ content_type == "application/json"
81
+ or (isinstance(standard_schema, str) and standard_schema.endswith("Request"))
82
+ or (
83
+ # Nested objects/arrays cannot round-trip through urlencoded forms
84
+ # without being JSON-stringified; prefer a real JSON body instead.
85
+ has_nested
86
+ and content_type != "multipart/form-data"
87
+ )
88
+ )
74
89
 
75
- if content_type == "application/json":
76
- kwargs["json"] = {k: v for k, v in request_data.body_params.items() if v is not None}
90
+ if use_json:
91
+ kwargs["json"] = body
77
92
  else:
78
93
  form_data = {}
79
- for key, value in request_data.body_params.items():
80
- if value is None:
81
- continue
94
+ for key, value in body.items():
82
95
  if isinstance(value, (dict, list)):
83
96
  form_data[key] = json.dumps(value)
84
97
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastsdk
3
- Version: 0.4.3
3
+ Version: 0.4.4
4
4
  Summary: Turn any AI/web service (OpenAPI, Replicate, RunPod, APIPod) into a native-feeling Python client.
5
5
  Author: SocAIty
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "fastsdk"
7
- version = "0.4.3"
7
+ version = "0.4.4"
8
8
  description = "Turn any AI/web service (OpenAPI, Replicate, RunPod, APIPod) into a native-feeling Python client."
9
9
  requires-python = ">=3.8"
10
10
  authors = [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes