Remove deprecated authentication properties and update related code#87
Remove deprecated authentication properties and update related code#87
Conversation
linarkou
commented
Jan 29, 2026
- Removed deprecated fields and methods in GigaChatApiProperties related to authentication
- Updated GigaChatAutoConfiguration to use new authentication properties
- Updated GigaChatEmbeddingModel to extend AbstractEmbeddingModel and use known embedding dimensions
- Updated GigaChatApi to use new authentication properties and constants
- Updated GigaChatAuthProperties with helper methods and documentation
- Updated GigaChatOAuthClient to use new authentication properties
- Updated EmbeddingsModel to implement EmbeddingModelDescription and add dimensions
- Updated tests to reflect changes in authentication and model usage
- Removed deprecated ChatModel values and updated tests to use new models
|
@claude проведи ревью |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
| auth.getCerts().getCertificate().getInputStream(), | ||
| auth.getCerts().getPrivateKey().getInputStream())); | ||
| } | ||
| } else if (gigaChatApiProperties.getClientKey() != null |
| public enum EmbeddingsModel implements EmbeddingModelDescription { | ||
| EMBEDDINGS("Embeddings", 1024), | ||
| EMBEDDINGS_2("Embeddings-2", 1024), | ||
| EMBEDDINGS_GIGA_R("EmbeddingsGigaR", 2560); |
There was a problem hiding this comment.
Недавно спрашивали, когда появится
- Removed deprecated fields and methods in GigaChatApiProperties related to authentication - Updated GigaChatAutoConfiguration to use new authentication properties - Updated GigaChatEmbeddingModel to extend AbstractEmbeddingModel and use known embedding dimensions - Updated GigaChatApi to use new authentication properties and constants - Updated GigaChatAuthProperties with helper methods and documentation - Updated GigaChatOAuthClient to use new authentication properties - Updated EmbeddingsModel to implement EmbeddingModelDescription and add dimensions - Updated tests to reflect changes in authentication and model usage - Removed deprecated ChatModel values and updated tests to use new models Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
ffff9e7 to
86e012b
Compare
|
Issues Found:
|
- Add description to @return in buildApiKey() method in GigaChatAuthProperties.java - Remove commented code in Russian in GigaChatApi.java - Add null check before using defaultOptions.getModel() in GigaChatEmbeddingModel.java Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
spring-ai-gigachat/src/main/java/chat/giga/springai/api/auth/GigaChatAuthProperties.java
Outdated
Show resolved
Hide resolved
Результаты ревьюНашёл одну потенциальную проблему в методе Остальные изменения выглядят корректно:
Пожалуйста, исправьте указанный баг перед мёрджем. |
buildApiKey() return null apiKey if neither apiKey nor clientId/clientSecret are present Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
| public String buildApiKey() { | ||
| if (StringUtils.hasText(this.apiKey)) { | ||
| return this.apiKey; | ||
| } |
There was a problem hiding this comment.
Дублирование кода: проверка if (StringUtils.hasText(this.apiKey)) выполняется дважды. Нужно удалить один из блоков.
| public String buildApiKey() { | |
| if (StringUtils.hasText(this.apiKey)) { | |
| return this.apiKey; | |
| } | |
| public String buildApiKey() { | |
| if (StringUtils.hasText(this.apiKey)) { | |
| return this.apiKey; | |
| } | |
| if (StringUtils.hasText(this.clientId) && StringUtils.hasText(this.clientSecret)) { | |
| return HttpHeaders.encodeBasicAuth(this.clientId, this.clientSecret, StandardCharsets.UTF_8); | |
| } | |
| return null; | |
| } |
Обзор PRНайдена критическая проблема: Ошибка компиляции
Пожалуйста, исправьте эту проблему перед мержем. Общие замечанияВ остальном изменения выглядят корректно:
|
Signed-off-by: Linar Abzaltdinov <abzaltdinov@gmail.com>
Найдена критическая ошибкаВ методе После исправления этой проблемы, PR можно будет одобрить. |
There was a problem hiding this comment.
Найдена критическая ошибка
В методе GigaChatAuthProperties.Bearer.buildApiKey() (строки 293-298 добавленного кода) обнаружено дублирование проверки:
if (StringUtils.hasText(this.apiKey)) {
return this.apiKey;
}
if (StringUtils.hasText(this.apiKey)) { // ← Дубликат!
return this.apiKey;
}Второй блок проверки apiKey (строки 296-298) является мертвым кодом и никогда не выполнится, так как если apiKey имеет значение, метод уже вернется на строке 294.
Нужно удалить строки 296-298 или изменить вторую проверку на что-то другое (если это была опечатка).
Остальные изменения выглядят хорошо:
- ✅ Корректное удаление deprecated полей
- ✅ Правильная миграция на новые
GigaChatAuthProperties - ✅ Обновление тестов
- ✅ Добавление размерностей в
EmbeddingsModel - ✅ Использование
AbstractEmbeddingModelдля оптимизации
После исправления дубликата в buildApiKey() PR можно будет одобрить.
Signed-off-by: Linar Abzaltdinov <abzaltdinov@gmail.com>
spring-ai-gigachat/src/main/java/chat/giga/springai/GigaChatEmbeddingModel.java
Show resolved
Hide resolved
|
Обнаружена одна проблема с потенциальным NPE в GigaChatEmbeddingModel. Пожалуйста, посмотрите inline комментарий. |
linarkou
left a comment
There was a problem hiding this comment.
Все недочеты исправлены