Skip to content

fix (docs): fix OpenRouter code examples #5876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025

Conversation

8enSmith
Copy link
Contributor

@8enSmith 8enSmith commented Apr 21, 2025

Background

Whilst working with @openrouter/ai-sdk-provider version 0.4.5 I found a few issues with the OpenRouter code examples in the documentation.

Some of the functions used in the examples are incorrect i.e. they do not exist e.g. chatModel should be chat and completionModel should be completion. You can see the correct definitions of these functions in the ai-sdk-provider library here.

Summary

This PR fixes the wrongly named functions i.e. chatModel changed to chat and completionModel changed to completion.

Tasks

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • If required, a patch changeset for relevant packages has been added
  • You've run pnpm prettier-fix to fix any formatting issues

Some of the functions used in the examples is incorrect e.g. chatModel should be chat. This commit fixes these issues.
@8enSmith 8enSmith changed the title fix(content/providers): fix openrouter code examples fix(content/providers): fix OpenRouter code examples Apr 21, 2025
@8enSmith 8enSmith changed the title fix(content/providers): fix OpenRouter code examples fix(content/providers): docs: fix OpenRouter code examples Apr 21, 2025
@lgrammel lgrammel changed the title fix(content/providers): docs: fix OpenRouter code examples fix (docs): fix OpenRouter code examples Apr 22, 2025
@lgrammel lgrammel merged commit 5b91c6a into vercel:main Apr 22, 2025
6 of 7 checks passed
samdenty pushed a commit that referenced this pull request Apr 22, 2025
Co-authored-by: Ben Smith <write.to.ben.smith@gmail.com>
lgrammel added a commit that referenced this pull request Apr 23, 2025
Co-authored-by: Ben Smith <8enSmith@users.noreply.github.com>
Co-authored-by: Ben Smith <write.to.ben.smith@gmail.com>
Co-authored-by: Lars Grammel <lars.grammel@gmail.com>
samdenty added a commit that referenced this pull request Apr 24, 2025
…ining2

* origin/v5: (25 commits)
  chore(providers/langchain): extract to separate package (#5928)
  Version Packages (canary) (#5898)
  fix (docs): fix typo (#5914) (#5919)
  docs: update chat-with-pdf page to include updated provider information (#5895) (#5917)
  docs: Added documentation for function call parsing middleware (#5900)
  refactoring: extract SharedV2Headers (#5912)
  feat (providers/openai): add support for reasoning summaries (#5906) (#5909)
  fix (docs): fix OpenRouter code examples (#5876) (#5893)
  fix(providers/xai): return actual usage when streaming instead of NaN (#5873) (#5891)
  fix (docs): fix valibotSchema import (#5865) (#5889)
  fix (providers/fal): improve model compatibility (#5855) (#5892)
  chore: extract spec types (#5901)
  chore: remove logprobs (#5896)
  Version Packages (canary) (#5872)
  chore (ci): unify jobs & remove unnecessary example builds (#5894)
  feat (ai): allow using provider default temperature by specifying null (#5890)
  fix(ai/mcp-stdio): make `createChildProcess` synchronous to prevent spawn race condition (#5852) (#5888)
  feat (providers/google): add thinking config to provider options (#5842) (#5887)
  fix (examples): avoid mixed message types in `use-chat-streamdata-multistep` (#5824) (#5886)
  chore: restructure language model supported urls (#5882)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants