Skip to content

How to customize an AI API #1753

Open
Open
@1131659949

Description

@1131659949

Describe the bug
I attempted to implement AI functionality using a custom API. While the API returns data as expected, Blocknote does not render the data within the text content.

This is part of the frontend code.
`
const client = createBlockNoteAIClient({
apiKey: "PLACEHOLDER",
baseURL: BASE_URL + aiChatApi,
});
const model = createGroq({
// call via our proxy client
...client.getProviderSettings("openai"),
})("deepseek-r1-distill-llama-70b");

const editor = useCreateBlockNote({
    dictionary: {
        ...en,
        ai: aiEn, // add default translations for the AI extension
    },
    extensions: [
        createAIExtension({
            model,
        }),
    ],
    // We set some initial content for demo purposes
})

`

Image

We can see that the API is returning data, but BlockNote is still giving me an error message. Could you tell me how to fix this? Many thanks.

  • Node version: 10.8.3
  • Package manager: @blocknote/[email protected]
  • Browser: chrome
  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions