Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/ai-implement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,20 @@ jobs:
per_page: 10
});

if (issues.length === 0) {
console.log('No issues with ai-task label found.');
return JSON.stringify({ issueNumber: null, branchName: null });
}

const { data: comments } = await github.rest.issues.listComments({
issue_number: issues[0]?.number,
issue_number: issues[0].number,
owner: context.repo.owner,
repo: context.repo.repo
});

const hasPlan = comments.some(c => c.body.includes('## AI Implementation Plan'));

if (issues.length > 0 && hasPlan) {
if (hasPlan) {
issueNumber = issues[0].number;
branchName = 'ai/issue-' + issueNumber;
}
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,31 @@ jobs:
Prune-B2FileVersions -RelativePath 'TelegramSearchBot/moder_update_updater.exe'
Prune-B2FileVersions -RelativePath 'TelegramSearchBot/catalog.json'
b2 account clear
- name: Generate release body
shell: pwsh
env:
BUILD_VERSION: ${{ needs.prepare.outputs.build-version }}
run: |
$buildDate = Get-Date -Format "yyyy-MM-dd"
$body = @"
## Release $env:BUILD_VERSION

**Build Date**: $buildDate

**Full Release Package**: TelegramSearchBot-win-x64-full-$env:BUILD_VERSION.zip
**Updater**: moder_update_updater.exe

### Changes
"@
Set-Content -Path "$env:RUNNER_TEMP\release-body.md" -Value $body -Encoding utf8
Write-Host "Generated release body for version $env:BUILD_VERSION"
- name: Publish full package to GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.prepare.outputs.release-tag }}
target_commitish: ${{ github.sha }}
name: Release ${{ needs.prepare.outputs.build-version }}
body_path: ${{ runner.temp }}\release-body.md
generate_release_notes: true
fail_on_unmatched_files: true
overwrite_files: true
Expand Down
3 changes: 2 additions & 1 deletion TelegramSearchBot.Common/Model/AI/LLMProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public enum LLMProvider {
Gemini,
MiniMax = 4,
LMStudio = 5,
Anthropic = 6
Anthropic = 6,
ResponsesAPI = 7
}
}
6 changes: 5 additions & 1 deletion TelegramSearchBot.LLM.Test/Service/AI/LLM/LLMFactoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public LLMFactoryTests() {
_loggerMock = new Mock<ILogger<LLMFactory>>();

var openAILogger = new Mock<ILogger<OpenAIService>>();
var responsesLogger = new Mock<ILogger<OpenAIResponsesService>>();
var ollamaLogger = new Mock<ILogger<OllamaService>>();
var geminiLogger = new Mock<ILogger<GeminiService>>();
var anthropicLogger = new Mock<ILogger<AnthropicService>>();
Expand All @@ -51,6 +52,8 @@ public LLMFactoryTests() {
_dbContext, geminiLogger.Object, httpClientFactoryMock.Object);
var anthropicServiceMock = new Mock<AnthropicService>(
_dbContext, anthropicLogger.Object, messageExtensionServiceMock.Object, httpClientFactoryMock.Object);
var responsesService = new OpenAIResponsesService(
_dbContext, responsesLogger.Object, messageExtensionServiceMock.Object, httpClientFactoryMock.Object);

_factory = new LLMFactory(
_redisMock.Object,
Expand All @@ -59,7 +62,8 @@ public LLMFactoryTests() {
_ollamaServiceMock.Object,
_openAIServiceMock.Object,
_geminiServiceMock.Object,
anthropicServiceMock.Object);
anthropicServiceMock.Object,
responsesService);
}

[Fact]
Expand Down
8 changes: 6 additions & 2 deletions TelegramSearchBot.LLM/Service/AI/LLM/LLMFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class LLMFactory : IService, ILLMFactory {
private readonly OllamaService _ollamaService;
private readonly GeminiService _geminiService;
private readonly AnthropicService _anthropicService;
private readonly OpenAIResponsesService _openAIResponsesService;
private readonly ILogger<LLMFactory> _logger;
private readonly Dictionary<LLMProvider, ILLMService> _services;
public LLMFactory(
Expand All @@ -33,7 +34,8 @@ public LLMFactory(
OllamaService ollamaService,
OpenAIService openAIService,
GeminiService geminiService,
AnthropicService anthropicService
AnthropicService anthropicService,
OpenAIResponsesService openAIResponsesService
) {
this.connectionMultiplexer = connectionMultiplexer;
_dbContext = dbContext;
Expand All @@ -44,13 +46,15 @@ AnthropicService anthropicService
_ollamaService = ollamaService;
_geminiService = geminiService;
_anthropicService = anthropicService;
_openAIResponsesService = openAIResponsesService;
_services = new() {
[LLMProvider.OpenAI] = _openAIService,
[LLMProvider.Ollama] = _ollamaService,
[LLMProvider.Gemini] = _geminiService,
[LLMProvider.MiniMax] = _openAIService,
[LLMProvider.LMStudio] = _openAIService,
[LLMProvider.Anthropic] = _anthropicService
[LLMProvider.Anthropic] = _anthropicService,
[LLMProvider.ResponsesAPI] = _openAIResponsesService
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ private ILLMService GetLLMService(LLMProvider provider) {
LLMProvider.MiniMax => _serviceProvider.GetService(typeof(OpenAIService)) as ILLMService,
LLMProvider.LMStudio => _serviceProvider.GetService(typeof(OpenAIService)) as ILLMService,
LLMProvider.Anthropic => _serviceProvider.GetService(typeof(AnthropicService)) as ILLMService,
LLMProvider.ResponsesAPI => _serviceProvider.GetService(typeof(OpenAIResponsesService)) as ILLMService,
_ => null
};
}
Expand Down
Loading
Loading