Created
October 13, 2023 08:34
-
-
Save GuillaumeDaviid/b27a078a87aaae7cea0aef47cf08e665 to your computer and use it in GitHub Desktop.
service openai
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
import { Injectable } from '@angular/core'; | |
import { Configuration, OpenAIApi } from 'openai'; | |
import { environment } from '../environments/environment'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class OpenAiService { | |
constructor() { } | |
readonly configuration = new Configuration({ | |
apiKey: environment.apiKey | |
}); | |
readonly openai = new OpenAIApi(this.configuration); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment