Skip to content

feat(runtime): add OpenAI-compatible HTTP agent - #75

Open
walliai666 wants to merge 1 commit into
nexu-io:mainfrom
walliai666:feat/add-openai-api
Open

feat(runtime): add OpenAI-compatible HTTP agent#75
walliai666 wants to merge 1 commit into
nexu-io:mainfrom
walliai666:feat/add-openai-api

Conversation

@walliai666

@walliai666 walliai666 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Add openai-api agent def that speaks the /v1/chat/completions SSE protocol, covering OpenAI, Groq, Ollama, LM Studio, vLLM, and any OpenAI-shim provider.

Auth via OPENAI_API_KEY; base URL via OPENAI_BASE_URL (defaults to api.openai.com); model via HV_AGENT_MODEL (defaults to gpt-4o-mini).

Studio changes:

  • Register openai-api as an HTTP agent alongside anthropic-api in the settings panel, with dedicated BYOK env-var instructions (en + zh)
  • Add OpenAI SVG icon and agent description
  • Auto-select logic: prefer local CLI → anthropic-api → openai-api

Fix sanitizeAssistantProse to collapse generic ```json fences (OpenAI models wrap structured output in them) and clip mid-stream hv-* blocks before they bleed into the chat bubble.

Resolves #74

Add openai-api agent def that speaks the /v1/chat/completions SSE
protocol, covering OpenAI, Groq, Ollama, LM Studio, vLLM, and any
OpenAI-shim provider.

Auth via OPENAI_API_KEY; base URL via OPENAI_BASE_URL (defaults to
api.openai.com); model via HV_AGENT_MODEL (defaults to gpt-4o-mini).

Studio changes:
- Register openai-api as an HTTP agent alongside anthropic-api in the
  settings panel, with dedicated BYOK env-var instructions (en + zh)
- Add OpenAI SVG icon and agent description
- Auto-select logic: prefer local CLI → anthropic-api → openai-api

Fix sanitizeAssistantProse to collapse generic ```json fences (OpenAI
models wrap structured output in them) and clip mid-stream hv-* blocks
before they bleed into the chat bubble.
@lefarcen
lefarcen requested a review from PerishCode July 1, 2026 10:01
@lefarcen lefarcen added size/M Size M (100-299 LOC) risk/medium Medium risk type/feature Feature change labels Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/medium Medium risk size/M Size M (100-299 LOC) type/feature Feature change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(runtime): add OpenAI-compatible HTTP agent for BYOK

2 participants