Skip to content

Commit

Permalink
Update build accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
daxian-dbw committed Sep 10, 2024
1 parent 38fd9e1 commit b3dd3a3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
12 changes: 10 additions & 2 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function Start-Build
[string] $Runtime = [NullString]::Value,

[Parameter()]
[ValidateSet('openai-gpt', 'interpreter', 'ollama')]
[ValidateSet('openai-gpt', 'az-agent', 'interpreter', 'ollama')]
[string[]] $AgentToInclude,

[Parameter()]
Expand All @@ -40,7 +40,7 @@ function Start-Build
if (-not $AgentToInclude) {
$agents = $metadata.AgentsToInclude
$AgentToInclude = if ($agents -eq "*") {
@('openai-gpt', 'interpreter', 'ollama')
@('openai-gpt', 'az-agent', 'interpreter', 'ollama')
} else {
$agents.Split(",", [System.StringSplitOptions]::TrimEntries)
Write-Verbose "Include agents specified in Metadata.json"
Expand All @@ -63,6 +63,7 @@ function Start-Build
$module_dir = Join-Path $shell_dir "AIShell.Integration"

$openai_agent_dir = Join-Path $agent_dir "AIShell.OpenAI.Agent"
$az_agent_dir = Join-Path $agent_dir "AIShell.Azure.Agent"
$interpreter_agent_dir = Join-Path $agent_dir "AIShell.Interpreter.Agent"
$ollama_agent_dir = Join-Path $agent_dir "AIShell.Ollama.Agent"

Expand All @@ -73,6 +74,7 @@ function Start-Build
$module_help_dir= Join-Path $PSScriptRoot "docs" "cmdlets"

$openai_out_dir = Join-Path $app_out_dir "agents" "AIShell.OpenAI.Agent"
$az_out_dir = Join-Path $app_out_dir "agents" "AIShell.Azure.Agent"
$interpreter_out_dir = Join-Path $app_out_dir "agents" "AIShell.Interpreter.Agent"
$ollama_out_dir = Join-Path $app_out_dir "agents" "AIShell.Ollama.Agent"

Expand All @@ -93,6 +95,12 @@ function Start-Build
dotnet publish $openai_csproj -c $Configuration -o $openai_out_dir
}

if ($LASTEXITCODE -eq 0 -and $AgentToInclude -contains 'az-agent') {
Write-Host "`n[Build the Azure agents ...]`n" -ForegroundColor Green
$az_csproj = GetProjectFile $az_agent_dir
dotnet publish $az_csproj -c $Configuration -o $az_out_dir
}

if ($LASTEXITCODE -eq 0 -and $AgentToInclude -contains 'interpreter') {
Write-Host "`n[Build the Interpreter agent ...]`n" -ForegroundColor Green
$interpreter_csproj = GetProjectFile $interpreter_agent_dir
Expand Down
13 changes: 9 additions & 4 deletions shell/agents/AIShell.Azure.Agent/AIShell.Azure.Agent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@
<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.11.4" />
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.18.0" />
<PackageReference Include="AIShell.Abstraction" Version="0.1.0-alpha.12">
<ExcludeAssets>contentFiles</ExcludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\AIShell.Abstraction\AIShell.Abstraction.csproj">
<!-- Disable copying AIShell.Abstraction.dll to output folder -->
<Private>false</Private>
<!-- Disable copying the transitive dependencies to output folder -->
<ExcludeAssets>runtime</ExcludeAssets>
</ProjectReference>
</ItemGroup>

</Project>

0 comments on commit b3dd3a3

Please sign in to comment.