Skip to content

feat(codebase-navigator): add OpenAI port of augmented LLM tutorial - #33

Open
teamauresta wants to merge 2 commits into
agenticloops-ai:mainfrom
teamauresta:feat/openai-codebase-navigator
Open

feat(codebase-navigator): add OpenAI port of augmented LLM tutorial#33
teamauresta wants to merge 2 commits into
agenticloops-ai:mainfrom
teamauresta:feat/openai-codebase-navigator

Conversation

@teamauresta

Copy link
Copy Markdown

Summary

Closes #13 — ports the Codebase Navigator (Augmented LLM) tutorial from the Anthropic SDK to the OpenAI API.

What changed

New file: 01-foundations/06-codebase-navigator/02_augmented_llm_openai.py

  • Uses openai.OpenAI() with the Chat Completions API
  • Converts Anthropic tool definitions (input_schema) to OpenAI function calling format (function.parameters) inside _build_tool_definitions()
  • Uses OpenAITokenTracker from common for token usage tracking
  • Appends one tool message per tool_call_id (OpenAI protocol requirement)
  • Reuses all existing tools/, store/, and indexer/ modules without modification
  • Same agentic loop, same UX — only the provider SDK changes

Updated: pyproject.toml — added openai>=1.0.0 to dependencies

Updated: README.md — added 02_augmented_llm_openai.py row to the examples table; removed the now-resolved contributions callout

Testing

  • ruff check 02_augmented_llm_openai.py — ✅ all checks passed
  • ruff format --check 02_augmented_llm_openai.py — ✅ already formatted
  • Script runs independently with OPENAI_API_KEY set
  • All existing tool handlers (tools/, store/, indexer/) reused unchanged

Port 01_codebase_navigator.py (Anthropic) to the OpenAI API as
02_augmented_llm_openai.py. Closes agenticloops-ai#13.

- Use openai.OpenAI() with Chat Completions API
- Convert Anthropic tool definitions (input_schema) to OpenAI function
  calling format (function.parameters) in _build_tool_definitions()
- Use OpenAITokenTracker from common for token usage tracking
- Append one tool message per tool_call_id (OpenAI requirement)
- Reuse all existing tools/, store/, and indexer/ modules unchanged
- Add openai>=1.0.0 to pyproject.toml dependencies
- Update README examples table with new script row

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.

let's use 01_codebase_navigator_openai name to be consistent

Rename to follow consistent naming convention used across the module,
matching the pattern of 01_codebase_navigator.py.

Addresses review feedback from @amrynsky.
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.

Port Augmented LLM tutorial to OpenAI API

2 participants