Daniel Rochetti 3b11d468a8
feat(client): add function alias support (#7)
* feat(client): add function alias support

* fix(client): username in aliased url
2023-05-02 09:18:25 -07:00

19 lines
436 B
TypeScript

import * as fal from '@fal-ai/serverless-client';
fal.config({
host: 'gateway.alpha.fal.ai',
credentials: {
userId: process.env.FAL_USER_ID || '',
keyId: process.env.FAL_KEY_ID || '',
keySecret: process.env.FAL_KEY_SECRET || '',
},
});
export type GetJokeInput = {
language?: string;
};
export function getJoke(input?: GetJokeInput): Promise<{ joke: string }> {
return fal.run('fastapi_get_joke', { input });
}