const fulfillments = {
llm: async (llmDemands) => ({
llm_fulfillments: Object.fromEntries(
Object.keys(llmDemands.llm_demands).map((key) => [
key,
{
identifier: "llm_proxy",
api_base: "{platform_url}/api/v1/openai/",
api_key: contextToken.token,
api_model: "gpt-4o",
},
]),
),
}),
oauth: demands.oauthDemands
? async (oauthDemands) => ({
oauth_fulfillments: Object.fromEntries(
Object.keys(oauthDemands.oauth_demands).map((key) => [
key,
{ redirect_uri: "https://app.example.com/oauth/callback" },
]),
),
})
: undefined,
};
const metadata = await resolveMetadata(fulfillments);