Fix

2.1.6Performance Improvement

Python SDK - Fix API response compatibility issues (v0.1.1)

Fix API response compatibility issues (v0.1.1)

  • Make id, object, created fields optional in ChatCompletion
  • Make id, object, created, model fields optional in ChatCompletionChunk
  • Make Usage fields optional to handle empty usage objects in streaming
  • Fix streaming by using httpx send() with stream=True instead of stream context manager

Tested with real API calls:

  • Chat completions: working
  • Streaming: working
  • Embeddings: working
  • Tool calling: working