-
Notifications
You must be signed in to change notification settings - Fork 848
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from dorlanpabon/main
Add i18n traductor, english, spanish, chinese, ....
- Loading branch information
Showing
24 changed files
with
4,870 additions
and
2,700 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import OpenAI from 'openai'; | ||
import logger from "../utils/log"; | ||
|
||
const gptApi = async (promptGPT: string, model: string, key: string) => { | ||
logger.info(`promptGPT: ${promptGPT}`); | ||
const openai = new OpenAI({ | ||
apiKey: key, | ||
}); | ||
logger.info(`model: ${model}`); | ||
const chatCompletion = await openai.chat.completions.create({ | ||
messages: [{ role: 'user', content: promptGPT }], | ||
model: model, | ||
}); | ||
logger.info(`chatCompletion: ${JSON.stringify(chatCompletion)}`); | ||
|
||
return chatCompletion.choices[0].message.content; | ||
} | ||
|
||
export { gptApi }; |
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
Oops, something went wrong.