Skip to content

samples: add DaoXE OpenAI-compatible chat completion example#14151

Open
seven7763 wants to merge 3 commits into
microsoft:mainfrom
seven7763:samples/add-daoxe-openai-compatible
Open

samples: add DaoXE OpenAI-compatible chat completion example#14151
seven7763 wants to merge 3 commits into
microsoft:mainfrom
seven7763:samples/add-daoxe-openai-compatible

Conversation

@seven7763

Copy link
Copy Markdown

Contribution License Agreement

I have read the CLA and agree.

Description

Adds a concept sample that uses Semantic Kernel's OpenAIChatCompletion with a custom AsyncOpenAI client pointed at DaoXE (https://daoxe.com/v1), following the same pattern as the Ollama / LM Studio local OpenAI-compatible samples.

  • Env: DAOXE_API_KEY, optional DAOXE_MODEL (exact account model ID)
  • No static public model/price table
  • Multi-model multi-protocol gateway; this sample uses Chat Completions only

I maintain DaoXE. Broader client notes: https://github.com/seven7763/DaoXE-AI

Contribution Checklist

  • The code builds clean without any errors or warnings
  • I am acting nicely to everyone
  • I have added tests that prove my fix is effective or that my feature works (sample-only; follows existing local_models samples)
  • I have added necessary documentation (docstring + README link)

Demonstrate Semantic Kernel OpenAIChatCompletion with AsyncOpenAI
pointed at https://daoxe.com/v1, using env-based key and account model IDs.

Signed-off-by: seven7763 <seven7763@users.noreply.github.com>
Signed-off-by: seven7763 <seven7763@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 13, 2026 13:40
@seven7763
seven7763 requested a review from a team as a code owner July 13, 2026 13:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Python concept sample demonstrating how to use Semantic Kernel’s OpenAIChatCompletion connector against DaoXE’s OpenAI-compatible Chat Completions endpoint, aligning with the existing “local_models” OpenAI-compatible sample patterns (e.g., Ollama / LM Studio).

Changes:

  • Added a new daoxe_chat_completion.py concept sample that configures AsyncOpenAI(base_url="https://daoxe.com/v1") and runs a simple interactive chat loop.
  • Updated the concepts README to mention OpenAI-compatible gateways and link the new DaoXE sample.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
python/samples/concepts/README.md Adds a link/mention for the new DaoXE OpenAI-compatible chat completion sample.
python/samples/concepts/local_models/daoxe_chat_completion.py New DaoXE OpenAI-compatible chat completion sample using OpenAIChatCompletion with a custom AsyncOpenAI client.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +36 to +41
ai_model_id = os.environ.get("DAOXE_MODEL", "YOUR_DAOXE_MODEL_ID")
if ai_model_id == "YOUR_DAOXE_MODEL_ID":
print(
"Tip: export DAOXE_MODEL to an exact ID from "
"`curl -H \"Authorization: Bearer $DAOXE_API_KEY\" https://daoxe.com/v1/models`"
)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in efe3585: sample now fails fast when DAOXE_MODEL is unset/empty (same pattern as DAOXE_API_KEY), with a pointer to GET /v1/models for the account-scoped ID.

Copilot review: avoid continuing with a placeholder model ID that
only fails later with a confusing API error.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@seven7763

Copy link
Copy Markdown
Author

Addressed the Copilot note in efe3585: the sample now fails fast when DAOXE_MODEL is unset/empty (same as the existing DAOXE_API_KEY check), with a short pointer to GET /v1/models for the exact account-scoped ID.

@seven7763

Copy link
Copy Markdown
Author

Friendly bump: Copilot note about fail-fast when DAOXE_MODEL is unset was addressed. Happy to tweak further if needed.

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