[HN Gopher] Use the Gemini API with OpenAI Fallback in TypeScript
___________________________________________________________________
Use the Gemini API with OpenAI Fallback in TypeScript
Author : l5870uoo9y
Score : 10 points
Date : 2025-04-04 09:41 UTC (2 days ago)
(HTM) web link (sometechblog.com)
(TXT) w3m dump (sometechblog.com)
| bearjaws wrote:
| The Vercel AI SDK abstracts against all LLMs, including locally
| running ones. It even handles file attachments well, which is
| something people are using more and more.
|
| https://sdk.vercel.ai/docs/introduction
|
| It uses zod for types and validation, I've loved using it to make
| my apps swap between models easily.
| urbandw311er wrote:
| That's a good spot. Is it open source or is it paid software?
| I've been using Braintrust Proxy for this until now.
| bearjaws wrote:
| https://github.com/vercel/ai
|
| Its Apache 2.0 licensed
| ilrwbwrkhv wrote:
| Typescript looks so ugly visually. It gives me PHP vibes. I think
| it's the large words at the first column of the eye line:
|
| export const
|
| function
|
| type
|
| return
|
| etc
|
| This makes scanning through the code really hard because your eye
| has to jump horizontally.
| sprobertson wrote:
| which of those words are large?
___________________________________________________________________
(page generated 2025-04-06 23:00 UTC)