Skip to content

feat(chat_github): Use newer REST API base url - #726

Merged
hadley merged 6 commits into
mainfrom
feat/chat-github-new-base-url
Aug 24, 2025
Merged

hadley merged 6 commits into
mainfrom
feat/chat-github-new-base-url

Conversation

@gadenbuie

@gadenbuie gadenbuie commented Aug 22, 2025 •

Copy link
Copy Markdown
Collaborator

Updates chat_github() to use https://models.github.ai/inference instead of https://models.inference.ai.azure.com, while leaving a note in the docs about the previous base_url.

I also updated models_github(), which includes some newer fields. I kept support for listing models from the previous endpoint, too.

One interesting twist: GitHub models use the provider/model format. So I carved out an exception in chat() that lets users write chat("github/openai/gpt-4.1") (that requires #699 to work).

@gadenbuie
gadenbuie requested a review from hadley August 22, 2025 16:46
Comment thread R/provider-any.R Outdated
model <- pieces[[2]]
} else if (provider == "github") {
# GitHub model names use the `provider/model` format
model <- paste(pieces[-1], collapse = "/")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about open router and friends? Do they use this format too? Maybe we should just pass along unconditionally and allow the model to error?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that sounds reasonable. It's how I implemented this first until I saw the chat() tests and became conflicted. I'd certainly rather let the API throw than to need to maintain a list of exceptions here.

@hadley
hadley merged commit b946946 into main Aug 24, 2025
@hadley
hadley deleted the feat/chat-github-new-base-url branch August 24, 2025 19:52
schloerke added a commit that referenced this pull request Sep 9, 2025
* main: (95 commits)
  fix(chat): Call `check_echo()` in `chat()` for consistent echo behavior (#742)
  Increment version number to 0.3.2.9000
  Increment version number to 0.3.2
  Don't run `content_image()` on CRAN (#739)
  feat(chat_): Add `params` and `model` to all `chat_` functions (#699)
  Fix spelling in `tool_prompt.md` (#730)
  Fix typos in source comments and regenerate documentation (#736)
  Fix news bullet
  Increment version number to 0.3.1.9000
  Increment version number to 0.3.1
  Update cran comments
  Check revdpes
  Re-build readme
  Typo fixes (#686)
  Polish news
  Update to latest Air settings and use `format-suggest.yaml` (#683)
  Use newer REST API base url (#726)
  Fix auth scope and API endpoints for Google Vertex (#704)
  Run `Rscript data-raw/prices.R` to update pricing info (#727)
  Improve error message for `batch_chat()` (#716)
  ...
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