Skip to content

Commit b62fbdd

Browse files
committed
5.0.1 release
1 parent 511e49b commit b62fbdd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1641
-187
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ az deployment group create --template-file ./bicep/main.bicep --resource-group <
7777

7878
|プレースホルダー|置換|
7979
|-|-|
80-
|`{{VITE_FUNCTION_APP_URL}}`|**関数アプリのドメイン名**|
80+
|`{{AZURE_FUNCTION_APP_DOMAIN_NAME}}`|**関数アプリのドメイン名**|
8181
|`{{VITE_TELEMETRY_CONNECTION_STRING}}`|**Application Insights の接続文字列**|
8282

8383
3. `source/server/Karamem0.Commistant.Web` フォルダーに移動します。
@@ -91,7 +91,7 @@ dotnet publish --configuration Release
9191
5. `publish` フォルダーの中身を圧縮します。
9292

9393
```
94-
Compress-Archive -Path ./bin/Release/net8.0/publish/* -DestinationPath ../../build.zip
94+
Compress-Archive -Path ./bin/Release/net10.0/publish/* -DestinationPath ../../build.zip
9595
```
9696

9797
6. Azure CLI で ZIP ファイルをアップロードします。
@@ -113,7 +113,7 @@ dotnet publish --configuration Release
113113
2. `publish` フォルダーの中身を圧縮します。
114114

115115
```
116-
Compress-Archive -Path ./bin/Release/net8.0/publish/* -DestinationPath ../../build.zip
116+
Compress-Archive -Path ./bin/Release/net10.0/publish/* -DestinationPath ../../build.zip
117117
```
118118

119119
3. Azure CLI で ZIP ファイルをアップロードします。
@@ -131,8 +131,8 @@ az webapp deploy --name <関数アプリの名前> --resource-group <リソー
131131
|プレースホルダー|置換|
132132
|-|-|
133133
|`{{AZURE_WEB_APP_DOMAIN_NAME}}`|**Web アプリのドメイン名**|
134-
|`{{MICROSOFT_APP_ID}}`|**アプリケーション ID**|
135-
|`{{MICROSOFT_BOT_ID}}`|**ボット ID**|
134+
|`{{MICROSOFT_TEAMS_APP_ID}}`|**アプリケーション ID**|
135+
|`{{MICROSOFT_365_AGENT_ID}}`|**アプリケーション ID**|
136136

137137
3. `manifest` フォルダーの中身を圧縮します。
138138

source/server/Karamem0.Commistant.Common/Models/CommandOptionsValue.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,23 @@
66
// https://github.com/karamem0/commistant/blob/main/LICENSE
77
//
88

9+
using System.Text.Json.Serialization;
10+
911
namespace Karamem0.Commistant.Models;
1012

1113
public record CommandOptionsValue
1214
{
1315

16+
[JsonPropertyName("enabled")]
1417
public bool Enabled { get; set; }
1518

19+
[JsonPropertyName("schedule")]
1620
public int Schedule { get; set; } = -1;
1721

22+
[JsonPropertyName("message")]
1823
public string? Message { get; set; }
1924

25+
[JsonPropertyName("url")]
2026
public string? Url { get; set; }
2127

2228
}

source/server/Karamem0.Commistant.Common/Models/CommandSettings.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,53 @@
66
// https://github.com/karamem0/commistant/blob/main/LICENSE
77
//
88

9+
using System.Text.Json.Serialization;
10+
911
namespace Karamem0.Commistant.Models;
1012

1113
public record CommandSettings
1214
{
1315

16+
[JsonPropertyName("meetingStartedSended")]
1417
public bool MeetingStartedSended { get; set; }
1518

19+
[JsonPropertyName("meetingStartedSchedule")]
1620
public int MeetingStartedSchedule { get; set; } = -1;
1721

22+
[JsonPropertyName("meetingStartedMessage")]
1823
public string? MeetingStartedMessage { get; set; }
1924

25+
[JsonPropertyName("meetingStartedUrl")]
2026
public string? MeetingStartedUrl { get; set; }
2127

28+
[JsonPropertyName("meetingEndingSended")]
2229
public bool MeetingEndingSended { get; set; }
2330

31+
[JsonPropertyName("meetingEndingSchedule")]
2432
public int MeetingEndingSchedule { get; set; } = -1;
2533

34+
[JsonPropertyName("meetingEndingMessage")]
2635
public string? MeetingEndingMessage { get; set; }
2736

37+
[JsonPropertyName("meetingEndingUrl")]
2838
public string? MeetingEndingUrl { get; set; }
2939

40+
[JsonPropertyName("meetingInProgress")]
3041
public bool MeetingInProgress { get; set; }
3142

43+
[JsonPropertyName("meetingInProgressSchedule")]
3244
public int MeetingInProgressSchedule { get; set; } = -1;
3345

46+
[JsonPropertyName("meetingInProgressMessage")]
3447
public string? MeetingInProgressMessage { get; set; }
3548

49+
[JsonPropertyName("meetingInProgressUrl")]
3650
public string? MeetingInProgressUrl { get; set; }
3751

52+
[JsonPropertyName("scheduledEndTime")]
3853
public DateTime? ScheduledEndTime { get; set; }
3954

55+
[JsonPropertyName("scheduledStartTime")]
4056
public DateTime? ScheduledStartTime { get; set; }
4157

4258
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//
2+
// Copyright (c) 2022-2026 karamem0
3+
//
4+
// This software is released under the MIT License.
5+
//
6+
// https://github.com/karamem0/commistant/blob/main/LICENSE
7+
//
8+
9+
using Microsoft.Agents.Builder;
10+
using Microsoft.Agents.Builder.Dialogs;
11+
using Microsoft.Agents.Builder.State;
12+
using System.Threading;
13+
14+
namespace Karamem0.Commistant.Services;
15+
16+
public interface IDialogService<T> where T : Dialog
17+
{
18+
19+
Task<DialogTurnResult> RunAsync(
20+
ITurnContext turnContext,
21+
AgentState agentState,
22+
CancellationToken cancellationToken
23+
);
24+
25+
}
26+
27+
public class DialogService<T>(T dialog) : IDialogService<T> where T : Dialog
28+
{
29+
30+
private readonly T dialog = dialog;
31+
32+
public async Task<DialogTurnResult> RunAsync(
33+
ITurnContext turnContext,
34+
AgentState agentState,
35+
CancellationToken cancellationToken
36+
)
37+
{
38+
return await this.dialog.RunAsync(
39+
turnContext,
40+
agentState,
41+
cancellationToken
42+
);
43+
}
44+
45+
}

source/server/Karamem0.Commistant.Common/Services/OpenAIService.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public class OpenAIService(ChatClient chatClient) : IOpenAIService
3030
{
3131
var chatCompletionsOptions = new ChatCompletionOptions()
3232
{
33-
Temperature = 0.3f,
3433
Tools =
3534
{
3635
ChatTool.CreateFunctionTool(

source/server/Karamem0.Commistant.Function/Commands/MeetingEndingCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ILogger<MeetingEndingCommand> logger
3333

3434
private readonly IMapper mapper = mapper;
3535

36-
private readonly ILogger logger = logger;
36+
private readonly ILogger<MeetingEndingCommand> logger = logger;
3737

3838
public override async Task ExecuteAsync(
3939
CommandSettings commandSettings,

source/server/Karamem0.Commistant.Function/Commands/MeetingInProgressCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ILogger<MeetingInProgressCommand> logger
3333

3434
private readonly IMapper mapper = mapper;
3535

36-
private readonly ILogger logger = logger;
36+
private readonly ILogger<MeetingInProgressCommand> logger = logger;
3737

3838
public override async Task ExecuteAsync(
3939
CommandSettings commandSettings,

source/server/Karamem0.Commistant.Function/Commands/MeetingStartedCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ILogger<MeetingStartedCommand> logger
3333

3434
private readonly IMapper mapper = mapper;
3535

36-
private readonly ILogger logger = logger;
36+
private readonly ILogger<MeetingStartedCommand> logger = logger;
3737

3838
public override async Task ExecuteAsync(
3939
CommandSettings commandSettings,

source/server/Karamem0.Commistant.Function/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
_ = services.ConfigureOptions(configuration);
4343
_ = services.AddMapper();
4444
_ = services.AddConnectorClient();
45-
_ = services.AddServices(configuration);
4645
_ = services.AddCommands();
46+
_ = services.AddServices(configuration);
4747

4848
var app = builder.Build();
4949

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
//
2+
// Copyright (c) 2022-2026 karamem0
3+
//
4+
// This software is released under the MIT License.
5+
//
6+
// https://github.com/karamem0/commistant/blob/main/LICENSE
7+
//
8+
9+
using Karamem0.Commistant.Routes.Abstraction;
10+
using Microsoft.Agents.Builder.App;
11+
using Microsoft.Agents.Core.Models;
12+
using Microsoft.Agents.Storage;
13+
using NSubstitute;
14+
using NUnit.Framework;
15+
16+
namespace Karamem0.Commistant.Extensions.Test;
17+
18+
[Category("Karamem0.Commistant.Extensions")]
19+
public class AgentApplicationExtensionTests
20+
{
21+
22+
[Test()]
23+
public void OnActivity_Success()
24+
{
25+
// Setup
26+
var options = new AgentApplicationOptions(new MemoryStorage());
27+
var handler = Substitute.For<IRouteHandler>();
28+
// Execute
29+
var target = Substitute.For<AgentApplication>(options);
30+
_ = AgentApplicationExtension.OnActivity(target, ActivityTypes.Message, handler);
31+
// Assert
32+
_ = target.Received().OnActivity(
33+
ActivityTypes.Message,
34+
handler.InvokeAsync,
35+
RouteRank.Unspecified,
36+
default,
37+
default
38+
);
39+
}
40+
41+
[Test()]
42+
public void OnBeforeTurn_Success()
43+
{
44+
// Setup
45+
var options = new AgentApplicationOptions(new MemoryStorage());
46+
var handler = Substitute.For<ITurnEventHandler>();
47+
// Execute
48+
var target = Substitute.For<AgentApplication>(options);
49+
_ = AgentApplicationExtension.OnBeforeTurn(target, handler);
50+
// Assert
51+
_ = target.Received().OnBeforeTurn(handler.InvokeAsync);
52+
}
53+
54+
[Test()]
55+
public void OnConversationUpdate_Success()
56+
{
57+
// Setup
58+
var options = new AgentApplicationOptions(new MemoryStorage());
59+
var handler = Substitute.For<IRouteHandler>();
60+
// Execute
61+
var target = Substitute.For<AgentApplication>(options);
62+
_ = AgentApplicationExtension.OnConversationUpdate(target, ActivityTypes.ConversationUpdate, handler);
63+
// Assert
64+
_ = target.Received().OnConversationUpdate(
65+
ActivityTypes.ConversationUpdate,
66+
handler.InvokeAsync,
67+
RouteRank.Unspecified,
68+
default,
69+
default
70+
);
71+
}
72+
73+
[Test()]
74+
public void OnEvent_Success()
75+
{
76+
// Setup
77+
var options = new AgentApplicationOptions(new MemoryStorage());
78+
var handler = Substitute.For<IRouteHandler>();
79+
// Execute
80+
var target = Substitute.For<AgentApplication>(options);
81+
_ = AgentApplicationExtension.OnEvent(target, ActivityTypes.Event, handler);
82+
// Assert
83+
_ = target.Received().OnEvent(
84+
ActivityTypes.Event,
85+
handler.InvokeAsync,
86+
RouteRank.Unspecified,
87+
default,
88+
default
89+
);
90+
}
91+
92+
}

0 commit comments

Comments
 (0)