Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H-3922: Add Google Vertex AI calls to shared AI request logic #6290

Merged
merged 8 commits into from
Jan 30, 2025

Conversation

CiaranMn
Copy link
Member

@CiaranMn CiaranMn commented Jan 29, 2025

🌟 What is the purpose of this PR?

We have a function that provides a standard interface for calling AI models, and translates it into the specific format each provider requires.

This PR adds support for Google Vertex AI calls to that function. This means (1) it can be more easily used from anywhere in future, (2) requests are logged in the same standard format, and (3) usage is properly tracked.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

🛡 What tests cover this?

  • None yet.

❓ How to test this?

  1. Only possible locally, via uploading a document file (which triggers Gemini analysis).

📹 Demo

TODO

@CiaranMn CiaranMn self-assigned this Jan 29, 2025
@github-actions github-actions bot added area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/apps labels Jan 29, 2025
Copy link

codecov bot commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 0% with 298 lines in your changes missing coverage. Please review.

Project coverage is 21.03%. Comparing base (70aa0bb) to head (484c3dd).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
.../shared/get-llm-response/get-google-ai-response.ts 0.00% 51 Missing ⚠️
...et-google-ai-response/rewrite-schema-for-google.ts 0.00% 51 Missing ⚠️
...nse/get-google-ai-response/google-cloud-storage.ts 0.00% 39 Missing ⚠️
...ai-response/map-google-messages-to-llm-messages.ts 0.00% 31 Missing ⚠️
...activities/shared/use-file-system-file-from-url.ts 0.00% 30 Missing ⚠️
...t-google-ai-response/map-parts-and-upload-files.ts 0.00% 18 Missing ⚠️
...-activities/infer-metadata-from-document-action.ts 0.00% 16 Missing ⚠️
...ta-from-document-action/get-llm-analysis-of-doc.ts 0.00% 14 Missing ⚠️
...shared/get-llm-response/google-vertex-ai-client.ts 0.00% 14 Missing ⚠️
.../shared/get-llm-response/get-anthropic-response.ts 0.00% 6 Missing ⚠️
... and 9 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6290      +/-   ##
==========================================
- Coverage   21.21%   21.03%   -0.18%     
==========================================
  Files         573      580       +7     
  Lines       19664    19827     +163     
  Branches     2872     2928      +56     
==========================================
  Hits         4171     4171              
- Misses      15441    15604     +163     
  Partials       52       52              
Flag Coverage Δ
apps.hash-ai-worker-ts 1.34% <0.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@CiaranMn CiaranMn added this pull request to the merge queue Jan 30, 2025
Merged via the queue into main with commit 0d565dc Jan 30, 2025
57 checks passed
@CiaranMn CiaranMn deleted the cm/track-gemini-usage branch January 30, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/apps area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team
Development

Successfully merging this pull request may close these issues.

2 participants