Updates client to use the generateContent endpoint when not streaming

This commit is contained in:
2024-02-23 14:42:51 +00:00
parent 83335e65dc
commit 93285e53dd
4 changed files with 54 additions and 59 deletions

View File

@@ -11,6 +11,7 @@ pub enum Error {
Token(gcp_auth::Error),
Serde(serde_json::Error),
VertexError(types::Error),
NoCandidatesError,
}
impl Display for Error {
@@ -23,6 +24,9 @@ impl Display for Error {
Error::VertexError(e) => {
write!(f, "Vertex error: {}", serde_json::to_string(e).unwrap())
}
Error::NoCandidatesError => {
write!(f, "No candidates returned for the prompt")
}
}
}
}