@farming-labs/docs 0.0.3-beta.3 → 0.0.3-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.mts +59 -8
  2. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -732,11 +732,62 @@ interface AIConfig {
732
732
  */
733
733
  triggerComponent?: unknown;
734
734
  /**
735
- * The LLM model to use for chat completions.
736
- * Must be compatible with the OpenAI Chat Completions API.
735
+ * The LLM model configuration.
736
+ *
737
+ * **Simple** — pass a plain string for a single model:
738
+ * ```ts
739
+ * model: "gpt-4o-mini"
740
+ * ```
741
+ *
742
+ * **Advanced** — pass an object with multiple selectable models and an
743
+ * optional `provider` key that references a named provider in `providers`:
744
+ * ```ts
745
+ * model: {
746
+ * models: [
747
+ * { id: "gpt-4o-mini", label: "GPT-4o mini (fast)", provider: "openai" },
748
+ * { id: "llama-3.3-70b-versatile", label: "Llama 3.3 70B", provider: "groq" },
749
+ * ],
750
+ * defaultModel: "gpt-4o-mini",
751
+ * }
752
+ * ```
753
+ *
754
+ * When an object is provided, a model selector dropdown appears in the
755
+ * AI chat interface.
756
+ *
737
757
  * @default "gpt-4o-mini"
738
758
  */
739
- model?: string;
759
+ model?: string | {
760
+ models: {
761
+ id: string;
762
+ label: string;
763
+ provider?: string;
764
+ }[];
765
+ defaultModel?: string;
766
+ };
767
+ /**
768
+ * Named provider configurations for multi-provider setups.
769
+ *
770
+ * Each key is a provider name referenced by `model.models[].provider`.
771
+ * Each value contains a `baseUrl` and optional `apiKey`.
772
+ *
773
+ * @example
774
+ * ```ts
775
+ * providers: {
776
+ * openai: {
777
+ * baseUrl: "https://api.openai.com/v1",
778
+ * apiKey: process.env.OPENAI_API_KEY,
779
+ * },
780
+ * groq: {
781
+ * baseUrl: "https://api.groq.com/openai/v1",
782
+ * apiKey: process.env.GROQ_API_KEY,
783
+ * },
784
+ * }
785
+ * ```
786
+ */
787
+ providers?: Record<string, {
788
+ baseUrl: string;
789
+ apiKey?: string;
790
+ }>;
740
791
  /**
741
792
  * Custom system prompt prepended to the AI conversation.
742
793
  * The documentation context is automatically appended after this prompt.
@@ -747,15 +798,15 @@ interface AIConfig {
747
798
  */
748
799
  systemPrompt?: string;
749
800
  /**
750
- * Base URL for an OpenAI-compatible API endpoint.
751
- * Use this to point to a self-hosted model, Azure OpenAI, or any
752
- * compatible provider (e.g. Groq, Together, OpenRouter).
801
+ * Default base URL for an OpenAI-compatible API endpoint.
802
+ * Used when no per-model `provider` is configured.
753
803
  * @default "https://api.openai.com/v1"
754
804
  */
755
805
  baseUrl?: string;
756
806
  /**
757
- * API key for the LLM provider.
758
- * Pass it via an environment variable to keep it out of source control.
807
+ * Default API key for the LLM provider.
808
+ * Used when no per-model `provider` is configured.
809
+ * Falls back to `process.env.OPENAI_API_KEY` if not set.
759
810
  *
760
811
  * @default process.env.OPENAI_API_KEY
761
812
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/docs",
3
- "version": "0.0.3-beta.3",
3
+ "version": "0.0.3-beta.4",
4
4
  "description": "Modern, flexible MDX-based docs framework — core types, config, and CLI",
5
5
  "keywords": [
6
6
  "docs",