From 3afc418cd2b92f0dc0a0e05ac9636193832deb0b Mon Sep 17 00:00:00 2001 From: Eli <43382407+eli64s@users.noreply.github.com> Date: Thu, 29 Feb 2024 23:15:43 -0600 Subject: [PATCH] Fix vertex ai response parsing bug. --- pyproject.toml | 2 +- readmeai/models/vertex.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 283fc47..cd1c074 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "readmeai" -version = "0.5.069" +version = "0.5.070" description = "👾 Automated README file generator, powered by LLM APIs." authors = ["Eli "] license = "MIT" diff --git a/readmeai/models/vertex.py b/readmeai/models/vertex.py index ec76760..001ec96 100644 --- a/readmeai/models/vertex.py +++ b/readmeai/models/vertex.py @@ -76,7 +76,7 @@ async def _make_request( prompt, generation_config=data, ) - content = response.text if response.text else response + content = response.candidates[0].content.parts[0].text self._logger.info(f"Response for '{index}':\n{content}") return index, clean_response(index, content)