refactor(ask-a-sailor): swap OpenAI for any-llm provider abstraction#25
Draft
Copilot wants to merge 3 commits into
Draft
refactor(ask-a-sailor): swap OpenAI for any-llm provider abstraction#25Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
…gent - Replace direct OpenAI calls with any_llm.completion() and any_llm.embedding() - Add LLM_MODEL env var support (default: gpt-4o-mini) - Update requirements.txt (root + ask-a-sailor) to use any-llm-sdk[openai] - Create .env.example with LLM_MODEL and provider key docs - Add LLM_MODEL to CI env vars - Add mocked any-llm tests (2 new tests) - Document provider swap in README Co-authored-by: fullharbor <237832340+fullharbor@users.noreply.github.com>
Co-authored-by: fullharbor <237832340+fullharbor@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add LLM provider abstraction for AskASailorAgent
refactor(ask-a-sailor): swap OpenAI for any-llm provider abstraction
Mar 11, 2026
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.
AskASailorAgenthard-codesOpenAI(), locking the agent to a single vendor. This swaps in mozilla-ai/any-llm so clubs can switch LLM providers via env var.Agent refactor
from openai import OpenAI→from any_llm import completion, embeddingself.client = OpenAI(); call module-levelcompletion()/embedding()directlyLLM_MODELenv var, falling back togpt-4o-miniDependencies
openai>=1.20.0→any-llm-sdk[openai]>=1.10.0in both root and package requirements (openai remains as transitive dep)Config & CI
.env.exampledocumentingLLM_MODELand provider API keysLLM_MODELadded to CI test envTests
test_agent_answer_with_mocked_any_llm— end-to-end with mockedcompletion/embeddingtest_agent_respects_llm_model_env— verifies env var propagates through to the completion callAll 30 tests pass (28 original + 2 new), 6 integration tests skipped as before.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.