feat(runtime): add OpenAI-compatible HTTP agent - #75
Open
walliai666 wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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