Skip to content

chore(cleanup): make llm openai compatible; clean up - #16

Merged
liupeirong merged 3 commits into
mainfrom
generalize-llm
Jun 8, 2026
Merged

chore(cleanup): make llm openai compatible; clean up#16
liupeirong merged 3 commits into
mainfrom
generalize-llm

Conversation

@liupeirong

Copy link
Copy Markdown
Owner

No description provided.

@github-actions

This comment has been minimized.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Generated by Agentic PR Review for issue #16 · opus46 4M

Comment thread src/vimai/config.py Outdated
deployment = os.environ.get("AZURE_OPENAI_DEPLOYMENT", "").strip()
endpoint = os.environ.get("OPENAI_BASE_URL", "").strip()
deployment = os.environ.get("OPENAI_MODEL", "").strip()
api_key = os.environ.get("OPENAI_API_KEY", "").strip()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Correctnessapi_key stored as "" instead of None when env var is absent.

os.environ.get("OPENAI_API_KEY", "").strip() yields "" when unset, but Config.api_key is typed str | None with default None. This works today because not "" is True, but downstream code checking config.api_key is None would behave differently.

Suggested fix:

api_key = os.environ.get("OPENAI_API_KEY", "").strip() or None

Comment thread .env.sample Outdated
# OPENAI_API_KEY="" optional; omit if using Entra ID
# LANGSMITH_API_KEY="" optional; set to enable tracing
# LANGSMITH_PROJECT=""......optional; default "vimai"
# VIMAI_EXTERNAL_AGENTS_DIR="" optiona; default "/path/to/vimai/.agents"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Documentation — Typo: "optiona" → "optional"

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

✅ Looks Good

All issues from the previous review have been resolved. The migration from Azure-specific env vars to generic OpenAI-compatible config is clean, correct, and well-tested.

Findings

# Dimension File Severity
1 Documentation src/vimai/llm.py:1 Low — stale module docstring still says "Azure OpenAI"

Verification

  • api_key correctly normalizes to None when absent (previous finding fixed)
  • MANIFEST.in no longer references deleted doc/ directory (previous finding fixed)
  • .env.sample typo fixed (previous finding fixed)
  • Dual auth path (Entra token provider vs. direct API key) is properly tested
  • Type annotations and Config dataclass are consistent

Cross-cutting observations

  • docs/ARCHITECTURE.md lost several contributor-facing sections (error handling, testing strategy, security). Not blocking, but worth restoring in a follow-up if those conventions are still active.
  • Vim help file (doc/vimai.txt) removed — users lose :help vimai. README covers setup, but consider a lightweight help file in the future.

Generated by Agentic PR Review for issue #16 · opus46 4M ·

Generated by Agentic PR Review for issue #16 · opus46 3.7M ·

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Generated by Agentic PR Review for issue #16 · opus46 3.7M

Comments that could not be inline-anchored

src/vimai/llm.py:1

Documentation — Module docstring is stale after this PR.

It still reads "Azure OpenAI LLM setup using Entra ID authentication" but the module now supports direct API key auth for any OpenAI-compatible endpoint. Consider updating to reflect both paths, e.g.:

"""OpenAI-compatible LLM setup with optional Entra ID authentication (F05)."""

@liupeirong
liupeirong merged commit aacbee8 into main Jun 8, 2026
7 checks passed
@liupeirong
liupeirong deleted the generalize-llm branch June 8, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant