|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to this project will be documented in this file. |
| 4 | + |
| 5 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
| 6 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 7 | + |
| 8 | +## [Released] |
| 9 | + |
| 10 | +### Added |
| 11 | +- **Assistants API (Beta)** - Full support for OpenAI Assistants v2 |
| 12 | + - Create, retrieve, and list Assistants |
| 13 | + - Thread management (create, retrieve, delete) |
| 14 | + - Message operations within threads |
| 15 | + - Run operations with streaming support |
| 16 | + - Vector Store support via `tool_resources` |
| 17 | + - File Search and Code Interpreter v2 capabilities |
| 18 | +- **Files API** - Upload, list, retrieve, and delete files |
| 19 | +- **Fine-tuning API** - Create and manage fine-tuning jobs |
| 20 | +- **Streaming for Assistants** - Server-Sent Events (SSE) support via `createRunStream` |
| 21 | +- **Vector Store Support** - New models for `ToolResources`, `FileSearchResources`, and `VectorStore` |
| 22 | +- **Coroutines Support** - All API methods now use `suspend` functions |
| 23 | +- **OpenAiConfig** - Configuration class for API key and client settings |
| 24 | + |
| 25 | +### Changed |
| 26 | +- **BREAKING**: Replaced callback-based API with Kotlin Coroutines |
| 27 | + - All methods now use `suspend` functions instead of callbacks |
| 28 | + - Error handling via try-catch instead of error callbacks |
| 29 | +- **BREAKING**: Removed `OpenAiInitializer` static initialization |
| 30 | + - Use `OpenAiConfig` constructor parameter instead |
| 31 | +- **Chat Completions** - Updated to support GPT-4 and GPT-3.5 Turbo features |
| 32 | + - Function calling / Tools support |
| 33 | + - JSON mode via `response_format` |
| 34 | + - Added `seed`, `system_fingerprint`, and other modern parameters |
| 35 | +- **Image Generation** - Updated for DALL-E 3 support |
| 36 | + - Added `model`, `quality`, and `style` parameters |
| 37 | +- **Audio API** - Enhanced transcription and translation endpoints |
| 38 | + - Added optional parameters: `prompt`, `response_format`, `temperature`, `language` |
| 39 | +- **Tool Definition** - Made `function` nullable to support `file_search` and `code_interpreter` types |
| 40 | +- **Moderation API** - Updated default model to `omni-moderation-latest` |
| 41 | + |
| 42 | +### Deprecated |
| 43 | +- **Completions API** - Legacy text completions (use Chat Completions instead) |
| 44 | +- **Edits API** - Legacy edits endpoint (use Chat Completions instead) |
| 45 | +- `file_ids` in `CreateAssistantRequest` - Use `tool_resources` for Assistants v2 |
| 46 | + |
| 47 | +### Updated |
| 48 | +- Gradle Wrapper to 8.6 |
| 49 | +- Android Gradle Plugin to 8.3.1 |
| 50 | +- Kotlin to 1.9.23 |
| 51 | +- AndroidX Core KTX to 1.12.0 |
| 52 | +- Material Components to 1.11.0 |
| 53 | +- Retrofit to 2.9.0 |
| 54 | +- OkHttp Logging Interceptor to 4.12.0 |
| 55 | +- Added lifecycle-runtime-ktx 2.6.2 for Coroutines support |
| 56 | + |
| 57 | +### Fixed |
| 58 | +- Import issues in various model files |
| 59 | +- Compilation errors related to deprecated APIs |
| 60 | + |
| 61 | +## Migration Guide |
| 62 | + |
| 63 | +### From Callbacks to Coroutines |
| 64 | + |
| 65 | +**Before:** |
| 66 | +```kotlin |
| 67 | +OpenAiInitializer.initialize("API_KEY") |
| 68 | +val client = OpenApiClient() |
| 69 | + |
| 70 | +client.getChatCompletion(messages) { result, error -> |
| 71 | + if (error != null) { |
| 72 | + // Handle error |
| 73 | + } else if (result != null) { |
| 74 | + // Use result |
| 75 | + } |
| 76 | +} |
| 77 | +``` |
| 78 | + |
| 79 | +**After:** |
| 80 | +```kotlin |
| 81 | +val config = OpenAiConfig(apiKey = "API_KEY") |
| 82 | +val client = OpenApiClient(config) |
| 83 | + |
| 84 | +lifecycleScope.launch { |
| 85 | + try { |
| 86 | + val result = client.getChatCompletion(messages) |
| 87 | + // Use result |
| 88 | + } catch (e: Exception) { |
| 89 | + // Handle error |
| 90 | + } |
| 91 | +} |
| 92 | +``` |
| 93 | + |
| 94 | +### Using Vector Stores |
| 95 | + |
| 96 | +```kotlin |
| 97 | +val assistant = CreateAssistantRequest( |
| 98 | + model = "gpt-4", |
| 99 | + tools = listOf(Tool(type = "file_search")), |
| 100 | + tool_resources = ToolResources( |
| 101 | + file_search = FileSearchResources( |
| 102 | + vector_store_ids = listOf("vs_123") |
| 103 | + ) |
| 104 | + ) |
| 105 | +) |
| 106 | +``` |
0 commit comments