Commit Graph

6 Commits

Author SHA1 Message Date
2b980e14b3 fix: post-review fixes — metadata, unknown types, typed tools, API polish
1. Add README, LICENSE (MIT), .gitignore, Makefile, CHANGELOG
2. Add Version constant and User-Agent header to all requests
3. Rename SetStream to EnableStream (narrower API surface)
4. Fix FinishReason in CompletionStreamChoice to use typed *FinishReason
5. Type conversation entry Content as chat.Content instead of json.RawMessage
6. Graceful unknown type handling — UnknownEntry, UnknownEvent,
   UnknownChunk, UnknownMessage, UnknownAgentTool all return data
   instead of erroring on unrecognized discriminator values
7. Type agent tools with AgentTool sealed interface + UnmarshalAgentTool
8. Add pagination params to ListConversations and ListLibraries
9. Move openapi.yaml to docs/openapi.yaml
2026-03-05 20:51:24 +01:00
1458c36c6d feat: Phase 8 OCR, audio, fine-tuning, batch jobs
OCR: document processing with pages, images, tables, dimensions.
Audio: transcription with file upload/URL, streaming events (language,
text delta, segment, done). Fine-tuning: job CRUD, cancel, start,
model archive/unarchive. Batch: job CRUD with cancel. Added
doMultipartStream for streaming multipart endpoints.
2026-03-05 20:04:05 +01:00
9778dd6a8e feat: Phase 5 retry + resilience — exponential backoff, jitter, Retry-After
Add retry logic to all HTTP methods:
- doRetry() core loop with configurable max retries
- Exponential backoff with 0.5-1.5x jitter
- Retry-After header support (seconds and HTTP-date)
- Retry on 429 and 5xx; no retry on 4xx client errors
- Context cancellation respected during retry delays
- Multipart uploads also retry via doRetry()
- 9 new tests: 429/500 recovery, exhaustion, no-retry-on-400, backoff math
2026-03-05 19:44:32 +01:00
75a726cbe2 feat: Phase 4 models + files — CRUD, multipart upload, signed URLs
Add model and file management:
- model/model.go: ModelCard (unified base/fine-tuned), ModelCapabilities
- file/file.go: File, ListParams, Purpose/SampleType/Source enums
- ListModels, GetModel, DeleteModel service methods
- UploadFile (multipart/form-data), ListFiles (query params), GetFile,
  DeleteFile, GetFileContent (binary stream), GetFileURL (signed URL)
- doMultipart() HTTP helper for file uploads
- 13 new tests covering all endpoints including multipart parsing
2026-03-05 19:41:39 +01:00
4686ed6898 feat: Phase 2 streaming — SSE parser, Stream[T], ChatCompleteStream
Add streaming infrastructure:
- SSE line parser handling multi-line data, comments, [DONE] sentinel
- Generic Stream[T] pull-based iterator (no goroutines, no channel leaks)
- doStream() HTTP helper for streaming endpoints
- ChatCompleteStream() method
- 28 new tests: SSE edge cases, iterator behavior, httptest integration
2026-03-05 19:33:07 +01:00
6332108c4d feat: Phase 1 foundation — client, chat types, ChatComplete
Implement core SDK skeleton with full chat completion support:
- Client with functional options (base URL, HTTP client, timeout, retry)
- APIError with sentinel checkers (IsNotFound, IsRateLimit, IsAuth)
- Chat types: Message (sealed interface, 4 types), ContentChunk (sealed
  interface, 7 types), Content (string|null|chunks union), Tool, ToolCall,
  ToolChoice, ResponseFormat with custom JSON marshal/unmarshal
- CompletionRequest/Response with discriminated union dispatch
- ChatComplete method with httptest-based tests (54 tests, all passing)
2026-03-05 19:30:57 +01:00