I’ve fine-tuned Gemini 1.0 in Google AI Studio and am now trying to use the model for production. I created a Service Account in my Google Cloud project, which provided me with a JSON file. I am attempting to make a call to my model using the following code:
const auth = new google.auth.GoogleAuth({
keyFile: './keyfile-path.json',
scopes: [
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/generative-language',
],
});
const client = await auth.getClient();
const accToken = await client.getAccessToken();
const authclient = client.setCredentials({ access_token: accToken.token });
const response = await firstValueFrom(
this.http.post(
'https://generativelanguage.googleapis.com/v1/model=tunedModels/my-model-name-here:generateContent',
{
prompt: prompt,
},
{
headers: {
Authorization: `Bearer ${accToken.token}`,
'Content-Type': 'application/json',
},
},
),
);
return response;
But I am facing error with this:
'https://generativelanguage.googleapis.com/v1/model=tunedModels/my-model-name-here:generateContent'
what could be the problem? am I writing this URL incorrectly?
Thank you in advance for your help. I would be grateful for any assistance you can provide.