Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 23, 2025

This PR updates all references to the deprecated Azure inference endpoint with the new GitHub AI endpoint across the entire codebase.

Changes Made

  • Replaced https://models.inference.ai.azure.com with https://models.github.ai in 56 Python files
  • Updated URL references in multiple contexts:
    • OpenAI client instantiations (openai.OpenAI and openai.AsyncOpenAI)
    • LangChain configurations (openai_api_base parameter)
    • LlamaIndex configurations (api_base parameter)
    • PydanticAI configurations (base_url parameter)

Files Updated

All Python files in both the root directory and spanish/ subdirectory that contained the old Azure inference URL, including:

  • Chat examples (chat.py, chat_async.py, chat_stream.py, etc.)
  • Function calling examples (function_calling_*.py)
  • RAG examples (rag_*.py, retrieval_augmented_generation.py)
  • Structured outputs examples (structured_outputs_*.py)
  • Library integration examples (chat_langchain.py, chat_llamaindex.py, chat_pydanticai.py)

Why This Change Is Needed

  • The Azure inference endpoint https://models.inference.ai.azure.com is being deprecated
  • GitHub AI endpoint https://models.github.ai provides better performance and reliability
  • Ensures future compatibility for all GitHub-hosted projects
  • Maintains consistency across the GitHub ecosystem

Verification

  • ✅ All 56 instances successfully replaced
  • ✅ No old URLs remain in the codebase
  • ✅ Code formatting and linting standards maintained (ruff and black pass)
  • ✅ All changes are minimal and surgical - only URL strings were modified

Fixes #29.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Replace Azure Inference URL with GitHub AI URL Replace Azure Inference URL with GitHub AI URL Jul 23, 2025
@Copilot Copilot AI requested a review from pamelafox July 23, 2025 06:21
Copilot finished work on behalf of pamelafox July 23, 2025 06:21
@pamelafox
Copy link
Owner

@copilot For the else block for "github", where you changed the URL, please also change the MODEL_NAME to

MODEL_NAME = os.getenv("GITHUB_MODEL", "openai/gpt-4o")

The difference is now that the string is "openai/gpt-4o" instead of just "gpt-4o".

Copy link
Contributor Author

Copilot AI commented Jul 24, 2025

@copilot For the else block for "github", where you changed the URL, please also change the MODEL_NAME to

MODEL_NAME = os.getenv("GITHUB_MODEL", "openai/gpt-4o")

...

Updated MODEL_NAME default for GitHub from "gpt-4o" to "openai/gpt-4o" in all 56 files. Fixed in commit 3b52120.

Copilot finished work on behalf of pamelafox July 24, 2025 05:51
@pamelafox pamelafox marked this pull request as ready for review July 24, 2025 06:36
@pamelafox pamelafox merged commit 83cfaaa into main Jul 24, 2025
1 check passed
@pamelafox pamelafox deleted the copilot/fix-29 branch July 24, 2025 06:36
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.

Replace Azure Inference URL with GitHub AI URL
2 participants