Skip to content

feat(providers): add NEAR AI Cloud provider - #9352

Merged
jamadeo merged 2 commits into
aaif-goose:mainfrom
PierreLeGuen:nearai-provider
May 22, 2026
Merged

feat(providers): add NEAR AI Cloud provider#9352
jamadeo merged 2 commits into
aaif-goose:mainfrom
PierreLeGuen:nearai-provider

Conversation

@PierreLeGuen

Copy link
Copy Markdown
Contributor

Summary

Adds NEAR AI Cloud as a fixed declarative OpenAI-compatible provider so users can configure NEARAI_API_KEY and use https://cloud-api.near.ai/v1.

Implementation Notes

  • Adds nearai provider metadata with dynamic model discovery and TEE-oriented fallback models.
  • Reuses the existing OpenAI-compatible provider path with NEAR-specific request normalization for chat completions.
  • Documents NEAR AI Cloud in the supported provider list and adds focused provider tests.

Testing

  • cargo fmt
  • cargo test -p goose nearai
  • cargo test -p goose providers::openai::tests::sanitize
  • cargo test -p goose providers::openai::tests::responses_api_routing_uses_model_family_unless_path_forces_chat

Related Issues

None.

Signed-off-by: Pierre LE GUEN <26087574+PierreLeGuen@users.noreply.github.com>
@PierreLeGuen
PierreLeGuen marked this pull request as ready for review May 21, 2026 15:36

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5253511d7a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/goose/src/providers/openai.rs Outdated
}

if Self::PROVIDERS_NEEDING_STANDARD_CHAT_PARAMS.contains(&self.name.as_str()) {
obj.remove("reasoning_effort");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve reasoning_effort for NEAR OpenAI reasoning models

Removing reasoning_effort for all nearai chat requests discards user-selected thinking levels for NEAR-hosted OpenAI reasoning models (for example openai/o3-mini and openai/gpt-5*). In this codebase, those models are recognized as reasoning-capable and the request builder emits reasoning_effort from model suffixes / thinking settings; stripping it here makes settings like -high or -none silently ineffective, which changes model behavior without warning.

Useful? React with 👍 / 👎.

@jamadeo jamadeo left a comment

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.

Looks good. I think on our side we can do a better job of expressing the ways in which providers might need to change the shape of the API structure. But that can happen outside this scope.

@jamadeo
jamadeo added this pull request to the merge queue May 22, 2026
Merged via the queue into aaif-goose:main with commit c434c84 May 22, 2026
23 checks passed
@PierreLeGuen
PierreLeGuen deleted the nearai-provider branch June 2, 2026 15:17
shafqatevo pushed a commit to shafqatevo/goose that referenced this pull request Aug 7, 2026
Signed-off-by: Pierre LE GUEN <26087574+PierreLeGuen@users.noreply.github.com>
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