Skip to content

custom separator ' > ' in provider registry doesn't work and throws NoSuchModelError #5712

@anatolzak

Description

@anatolzak

Description

The docs provide the following example

import { anthropic } from '@ai-sdk/anthropic';
import { openai } from '@ai-sdk/openai';

export const customSeparatorRegistry = createProviderRegistry(
  {
    anthropic,
    openai,
  },
  { separator: ' > ' },
);

When I try to use it

await generateText({
    model: customSeparatorRegistry.languageModel('openai > gpt-4o'),
    prompt: 'How many letters are in the word "hello"?',
})

I get NoSuchModelError [AI_NoSuchModelError]: No such languageModel: > gpt-4o

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelprovider/anthropicIssues related to the @ai-sdk/anthropic providerprovider/openaiIssues related to the @ai-sdk/openai providersupport

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions