Skip to content

Commit c9a6b5f

Browse files
Copilotpontemonti
andcommitted
Refactor: Move model files to models directory, one file per type
- Create models directory under src - Split ChatHistoryMessage and ChatMessageRequest into separate files - Add models/index.ts to export all models - Update imports in McpToolServerConfigurationService and tests - Delete old models.ts file - All 264 tests passing, no regressions Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>
1 parent c354f4f commit c9a6b5f

5 files changed

Lines changed: 35 additions & 26 deletions

File tree

packages/agents-a365-tooling/src/McpToolServerConfigurationService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import axios from 'axios';
77
import { TurnContext } from '@microsoft/agents-hosting';
88
import { OperationResult, OperationError } from '@microsoft/agents-a365-runtime';
99
import { MCPServerConfig, McpClientTool, ToolOptions } from './contracts';
10-
import { ChatHistoryMessage, ChatMessageRequest } from './models';
10+
import { ChatHistoryMessage, ChatMessageRequest } from './models/index';
1111
import { Utility } from './Utility';
1212

1313
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
/**
5+
* Represents a single message in the chat history.
6+
*/
7+
export interface ChatHistoryMessage {
8+
/**
9+
* The unique identifier for the chat message.
10+
*/
11+
id: string;
12+
13+
/**
14+
* The role of the message sender (e.g., "user", "assistant", "system").
15+
*/
16+
role: string;
17+
18+
/**
19+
* The content of the chat message.
20+
*/
21+
content: string;
22+
23+
/**
24+
* The timestamp of when the message was sent.
25+
*/
26+
timestamp: Date;
27+
}

packages/agents-a365-tooling/src/models.ts renamed to packages/agents-a365-tooling/src/models/ChatMessageRequest.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
/**
5-
* Represents a single message in the chat history.
6-
*/
7-
export interface ChatHistoryMessage {
8-
/**
9-
* The unique identifier for the chat message.
10-
*/
11-
id: string;
12-
13-
/**
14-
* The role of the message sender (e.g., "user", "assistant", "system").
15-
*/
16-
role: string;
17-
18-
/**
19-
* The content of the chat message.
20-
*/
21-
content: string;
22-
23-
/**
24-
* The timestamp of when the message was sent.
25-
*/
26-
timestamp: Date;
27-
}
4+
import { ChatHistoryMessage } from './ChatHistoryMessage';
285

296
/**
307
* Represents the request payload for a real-time threat protection check on a chat message.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
export * from './ChatHistoryMessage';
5+
export * from './ChatMessageRequest';

tests/tooling/models.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
import { ChatHistoryMessage, ChatMessageRequest } from '../../packages/agents-a365-tooling/src/models';
4+
import { ChatHistoryMessage, ChatMessageRequest } from '../../packages/agents-a365-tooling/src/models/index';
55

66
describe('Chat History Models', () => {
77
describe('ChatHistoryMessage', () => {

0 commit comments

Comments
 (0)