refactor source code

This commit is contained in:
2024-10-29 17:42:54 +07:00
parent 3b23d9e0b7
commit 152bb50da8
83 changed files with 8473 additions and 7577 deletions

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@nestjs/common';
import { OpenAI } from 'openai';
import { Injectable } from '@nestjs/common'
import { OpenAI } from 'openai'
@Injectable()
export class OpenaiService {
@@ -12,13 +12,13 @@ export class OpenaiService {
) {
const prompt = `
give me mail content for invitation to a workshop to EPESS and replace {{ mail }} with ${mail}, {{ username }} with ${username} and {{ url }} with ${url}
`;
`
const response = await this.openai.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: prompt }],
});
})
return response.choices[0].message.content;
return response.choices[0].message.content
}
}