Open ichabodcole opened 5 days ago
Issue appears to be with map-openrouter-chat-logprobs.ts
.
export function mapOpenRouterChatLogProbsOutput(
logprobs: OpenRouterChatLogProbs | null | undefined
): LanguageModelV1LogProbs | null | undefined {
return (
logprobs?.content?.map(({ token, logprob, top_logprobs }) => ({
token,
logprob,
topLogprobs: top_logprobs
? top_logprobs.map(({ token, logprob }) => ({
token,
logprob,
}))
: [],
}))
);
}
Hi, I'm currently using the vercel sdk using the
steamText
function, and currently hitting an issue with the response from a specific modelcognitivecomputations/dolphin-mixtral-8x22b
, other models I have tested seem to work as expected. I'm not sure if the issue is with this library or the Vercel library, but I figured I'd let check in here first.Below is the validation error I'm receiving.
Here is the streaming response data which causes the Zod validation error, it appears to be due to the "logprobs" value.
However the below succeeds with no issues, with
logprobs
set to null.