samples: add DaoXE OpenAI-compatible chat completion example#14151
samples: add DaoXE OpenAI-compatible chat completion example#14151seven7763 wants to merge 3 commits into
Conversation
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>
There was a problem hiding this comment.
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.pyconcept sample that configuresAsyncOpenAI(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.
| 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`" | ||
| ) |
There was a problem hiding this comment.
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>
|
Addressed the Copilot note in efe3585: the sample now fails fast when |
|
Friendly bump: Copilot note about fail-fast when |
Contribution License Agreement
I have read the CLA and agree.
Description
Adds a concept sample that uses Semantic Kernel's
OpenAIChatCompletionwith a customAsyncOpenAIclient pointed at DaoXE (https://daoxe.com/v1), following the same pattern as the Ollama / LM Studio local OpenAI-compatible samples.DAOXE_API_KEY, optionalDAOXE_MODEL(exact account model ID)I maintain DaoXE. Broader client notes: https://github.com/seven7763/DaoXE-AI
Contribution Checklist