-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08ebc67
commit 17b634f
Showing
6 changed files
with
81 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// STT 평가 모델 | ||
const { callOpenAI } = require("./openaiClient"); | ||
const { promptData, modelData } = require("./configLoader"); | ||
|
||
// 프롬프트, 모델명, 토큰 수 설정 | ||
const Prompt = promptData.stt_validation_241021; | ||
const modelName = modelData.stt_validation; | ||
const maxTokens = 256; | ||
|
||
// STT로 전사된 텍스트를 평가 | ||
async function getSttEvaluationModelResponse(gptInquiry, transcription) { | ||
// gpt 응답을 바탕으로 프롬프트 재구성 | ||
const modifiedPrompt = Prompt | ||
.replace("{}", `"${gptInquiry}"`) | ||
.replace("{}", `"${transcription}"`); | ||
|
||
// GPT API에 보낼 메세지 구성 | ||
const conversations = [ | ||
{ role: "system", content: modifiedPrompt }, | ||
{ role: "user", content: transcription }, | ||
]; | ||
|
||
// STT 평가 결과 | ||
const evaluationResult = await callOpenAI(modelName, conversations, maxTokens); | ||
|
||
return evaluationResult; | ||
} | ||
|
||
module.exports = {getSttEvaluationModelResponse}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters