Skip to content

Commit

Permalink
refactor: Update message model and resolver to use MessageRole enum
Browse files Browse the repository at this point in the history
  • Loading branch information
Sma1lboy committed Oct 29, 2024
1 parent 3e429b4 commit 61535d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/chat/chat.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable, Logger } from '@nestjs/common';
import { HttpService } from '@nestjs/axios';
import { ChatCompletionChunk, Chat } from './chat.model';
import { Message, Role } from 'src/chat/message.model';
import { Message, MessageRole } from 'src/chat/message.model';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { User } from 'src/user/user.model';
Expand Down Expand Up @@ -278,7 +278,7 @@ export class ChatService {
async saveMessage(
chatId: string,
messageContent: string,
role: Role,
role: MessageRole,
): Promise<Message> {
// Find the chat instance
const chat = await this.chatRepository.findOne({ where: { id: chatId } });
Expand Down

0 comments on commit 61535d3

Please sign in to comment.