Skip to content

Seperated model used for various tasks#33

Merged
mervyn-teo merged 3 commits intomasterfrom
model-seperation
Aug 20, 2025
Merged

Seperated model used for various tasks#33
mervyn-teo merged 3 commits intomasterfrom
model-seperation

Conversation

@mervyn-teo
Copy link
Owner

This pull request introduces support for using separate OpenAI clients and models for different tasks (base, compression, and image processing) throughout the application. The main changes include updating the settings structure to allow specifying separate models, refactoring client initialization to create and use multiple clients, and updating the message processing logic to use the appropriate client for each task.

Support for Multiple OpenAI Clients and Models:

  • Added a new Clients struct in client.go to hold separate OpenAI clients for base, compression, and image tasks.
  • Updated the Settings struct in settings.go to include CompressionModel and ImageModel fields, with logic to default these to the base model if not specified. Also added a DefaultModel constant and improved logging for model selection. [1] [2] [3]

Initialization and Usage Refactoring:

  • Refactored client initialization in main.go to create and assign separate OpenAI clients for base, compression, and image tasks using the new Clients struct. [1] [2]
  • Updated the MessageLoop function signature and its internal logic in chat.go to accept a Clients struct and use the appropriate client for sending messages, compressing messages, and image description generation. [1] [2] [3] [4]

@codecov
Copy link

codecov bot commented Aug 20, 2025

Codecov Report

❌ Patch coverage is 8.33333% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/storage/settings.go 0.00% 15 Missing ⚠️
cmd/api/main.go 0.00% 5 Missing ⚠️
internal/router/chat.go 50.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
internal/router/client.go 100.00% <ø> (ø)
internal/router/chat.go 54.75% <50.00%> (ø)
cmd/api/main.go 0.00% <0.00%> (ø)
internal/storage/settings.go 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mervyn-teo mervyn-teo merged commit 5fc1bdb into master Aug 20, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant