Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GuillaumeDaviid/b27a078a87aaae7cea0aef47cf08e665 to your computer and use it in GitHub Desktop.
Save GuillaumeDaviid/b27a078a87aaae7cea0aef47cf08e665 to your computer and use it in GitHub Desktop.
service openai
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