Skip to content

Commit

Permalink
vertex client cache fix
Browse files Browse the repository at this point in the history
  • Loading branch information
liamjxu committed Nov 14, 2024
1 parent e129456 commit f004fa1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/helm/clients/vertexai_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def get_model(model_name: str) -> GenerativeModel:
def make_request(self, request: Request) -> RequestResult:
"""Make a request"""
contents = [request.prompt]
content_key = request.prompt

# For the multimodal case, build up the content with the media objects of `request.multimodal_prompt`
if request.multimodal_prompt is not None:
Expand All @@ -214,6 +215,7 @@ def make_request(self, request: Request) -> RequestResult:
contents.append(
Content(role=role_mapping.get(msg["role"], "user"), parts=[Part.from_text(msg["content"])])
)
content_key = '\n'.join([msg["content"] for msg in request.messages])

parameters = {
"temperature": request.temperature,
Expand Down Expand Up @@ -280,6 +282,7 @@ def do_it() -> Dict[str, Any]:
{
"model_name": model_name,
"prompt": request.prompt,
"content": content_key,
**parameters,
},
request,
Expand Down

0 comments on commit f004fa1

Please sign in to comment.