Clova Studio 활용하기

Clova Studio

NOSQL을 활용해서 컨텍스트 기억하기

왜 NOSQL을 선택했을까?

export type LLMHistoryDocument = Document & LLMHistory;

const options: SchemaOptions = {
  timestamps: true,
};

@Schema(options)
export class LLMHistory {
  @Prop({ required: true })
  room: string;

  @Prop({
    required: true,
    type: [
      {
        role: { type: String, required: true },
        content: { type: String, required: true },
      },
    ],
  })
  messages: LLMMessageDto[];
}

export const LLMHistorySchema = SchemaFactory.createForClass(LLMHistory);