I'm trying to use `serverStreamingPredict` with `text-bison@001` and its always saying prompt is missing in the input field. But I did verified with verify method from StreamingPredictRequest and it return valid case - null. Unfortunately there are no examples provided, I followed the RESTAPI and types to create this.
Error:
Code:
async function callStreamingPredictForText(
publisher = "google",
model = "text-bison@001",
) {
// Configure the parent resource
const endpoint = `projects/${project}/locations/${location}/publishers/${publisher}/models/${model}`;
const request = {
endpoint,
inputs: [
{
prompt: "What are the cardinal directions?",
},
],
parameters: {
temperature: 0.2,
maxOutputTokens: 256,
topP: 0.95,
topK: 40,
},
};
const reqObject =
google.cloud.aiplatform.v1.StreamingPredictRequest.fromObject(request);
// console.log(
// ">>> inputs",
// google.cloud.aiplatform.v1.StreamingPredictRequest.toObject(reqObject),
// );
// Predict request
const response =
await predictionServiceClient.serverStreamingPredict(reqObject);
response.on("data", (data) => console.log(data));
}
User | Count |
---|---|
14 | |
1 | |
1 | |
1 | |
1 |