Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 67e872c

Browse files
committed
added response for get thread
1 parent 0dc55e6 commit 67e872c

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

cortex-js/src/infrastructure/controllers/threads.controller.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { ThreadsUsecases } from '@/usecases/threads/threads.usecases';
1212
import { CreateThreadDto } from '@/infrastructure/dtos/threads/create-thread.dto';
1313
import { UpdateThreadDto } from '@/infrastructure/dtos/threads/update-thread.dto';
1414
import { DeleteThreadResponseDto } from '@/infrastructure/dtos/threads/delete-thread.dto';
15+
import { GetThreadResponseDto } from '@/infrastructure/dtos/threads/get-thread.dto';
1516
import {
1617
ApiCreatedResponse,
1718
ApiOkResponse,
@@ -38,6 +39,11 @@ export class ThreadsController {
3839
return this.threadsService.findAll();
3940
}
4041

42+
@ApiResponse({
43+
status: 200,
44+
description: 'Ok',
45+
type: GetThreadResponseDto,
46+
})
4147
@ApiOperation({ summary: 'Get thread', description: "Retrieves a thread along with its configurations." })
4248
@ApiParam({ name: 'id', required: true, description: "The unique identifier of the thread." })
4349
@Get(':id')
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { ApiProperty } from '@nestjs/swagger';
2+
3+
export class GetThreadResponseDto {
4+
@ApiProperty({ example: 'thread_abc123', description: 'The identifier of the thread.' })
5+
id: string;
6+
7+
@ApiProperty({ example: 'thread', description: 'Type of the object' })
8+
object: string;
9+
10+
@ApiProperty({ example: 1699014083, description: 'Unix timestamp representing the creation time of the thread.', type: 'integer' })
11+
created_at: number;
12+
13+
@ApiProperty({ example: ['assistant-001'], description: 'List of assistants involved in the thread.', type: [String] })
14+
assistants: string[];
15+
16+
@ApiProperty({ example: {}, description: 'Metadata associated with the thread.' })
17+
metadata: object;
18+
19+
@ApiProperty({ example: [], description: 'List of messages within the thread.', type: [String] })
20+
messages: string[];
21+
}

0 commit comments

Comments
 (0)