Commit 3ad7006
committed
feat: address PR #116 feedback — base_url, expansion_model, env rename, embed fix
Changes based on PR comments:
1. Configurable base_url for OpenAI-compatible APIs (Ollama, vLLM, Azure)
- collections.ts: EmbeddingProviderConfig already has base_url field
- qmd.ts: now passes base_url and expansion_model from YAML to setEmbeddingConfig
- openai-llm.ts: constructor accepts baseURL config
2. Env var rename: QMD_OPENAI_API_KEY takes priority over OPENAI_API_KEY
- Avoids conflict with official openai-node SDK (per @alexleach)
- Falls back to OPENAI_API_KEY for backwards compatibility
3. generateEmbeddings bypasses LlamaCpp when using OpenAI (per @viniciushsantana)
- OpenAI path calls API directly, no local model session needed
- Refactored to shared runEmbedding() with pluggable embed/embedBatch fns
4. expandQuery now actually calls OpenAI for query expansion
- Was previously returning lex-only fallback when isUsingOpenAI()
- Now uses gpt-4o-mini via openaiLLM.expandQuery()
5. README updated with base_url, expansion_model docs
Addresses: @alexleach (env naming, base_url), @viniciushsantana (embed fix,
expansion_model, base_url YAML wiring)1 parent 5791764 commit 3ad7006
5 files changed
Lines changed: 100 additions & 47 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
527 | | - | |
| 527 | + | |
528 | 528 | | |
| 529 | + | |
| 530 | + | |
529 | 531 | | |
530 | 532 | | |
531 | 533 | | |
532 | 534 | | |
533 | 535 | | |
534 | 536 | | |
535 | 537 | | |
| 538 | + | |
536 | 539 | | |
537 | | - | |
| 540 | + | |
538 | 541 | | |
539 | 542 | | |
540 | 543 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2826 | 2826 | | |
2827 | 2827 | | |
2828 | 2828 | | |
| 2829 | + | |
| 2830 | + | |
2829 | 2831 | | |
2830 | 2832 | | |
2831 | 2833 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
0 commit comments