Skip to content

Commit

Permalink
fix(types): add InteropMessageRole (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
theodoracheng authored Sep 10, 2024
1 parent 9c9fb26 commit c593ba6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export interface OpenAICompatibilityPayload {
}

export interface CopilotMessage {
role: string;
role: MessageRole;
content: string;
copilot_references?: MessageCopilotReference[];
copilot_confirmations?: MessageCopilotConfirmation[];
Expand All @@ -116,7 +116,8 @@ export interface CopilotMessage {
[key: string]: unknown;
}

export interface InteropMessage<TRole extends string = string> {
export type MessageRole = 'system' | 'user' | 'assistant';
export interface InteropMessage<TRole extends MessageRole = MessageRole> {
role: TRole;
content: string;
name?: string;
Expand Down
2 changes: 1 addition & 1 deletion index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export function transformPayloadForOpenAICompatibilityTest(
expectType<{
messages: {
content: string;
role: string;
role: 'system' | 'user' | 'assistant';
name?: string;
[key: string]: unknown;
}[];
Expand Down

0 comments on commit c593ba6

Please sign in to comment.