1
This commit is contained in:
13
prisma/api.ts
Normal file
13
prisma/api.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { GoogleGenAI } from "@google/genai";
|
||||
|
||||
export const getAI = (config?: { apiKey?: string; baseUrl?: string }) => {
|
||||
const options: any = {
|
||||
apiKey: config?.apiKey || process.env.API_KEY,
|
||||
};
|
||||
|
||||
if (config?.baseUrl) {
|
||||
options.baseUrl = config.baseUrl;
|
||||
}
|
||||
|
||||
return new GoogleGenAI(options);
|
||||
};
|
||||
Reference in New Issue
Block a user