@launchdarkly/server-sdk-ai 0.10.1 → 0.11.0
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.
- package/CHANGELOG.md +13 -0
- package/__tests__/LDAIClientImpl.test.ts +328 -1
- package/__tests__/LDAIConfigTrackerImpl.test.ts +94 -136
- package/dist/LDAIClientImpl.d.ts +7 -0
- package/dist/LDAIClientImpl.d.ts.map +1 -1
- package/dist/LDAIClientImpl.js +60 -11
- package/dist/LDAIClientImpl.js.map +1 -1
- package/dist/LDAIConfigTrackerImpl.d.ts +3 -1
- package/dist/LDAIConfigTrackerImpl.d.ts.map +1 -1
- package/dist/LDAIConfigTrackerImpl.js +5 -3
- package/dist/LDAIConfigTrackerImpl.js.map +1 -1
- package/dist/api/LDAIClient.d.ts +70 -0
- package/dist/api/LDAIClient.d.ts.map +1 -1
- package/dist/api/agents/LDAIAgent.d.ts +32 -0
- package/dist/api/agents/LDAIAgent.d.ts.map +1 -0
- package/dist/api/agents/LDAIAgent.js +3 -0
- package/dist/api/agents/LDAIAgent.js.map +1 -0
- package/dist/api/agents/index.d.ts +2 -0
- package/dist/api/agents/index.d.ts.map +1 -0
- package/dist/api/agents/index.js +18 -0
- package/dist/api/agents/index.js.map +1 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/docs/assets/highlight.css +15 -8
- package/docs/assets/search.js +1 -1
- package/docs/enums/LDFeedbackKind.html +11 -8
- package/docs/functions/createBedrockTokenUsage.html +9 -6
- package/docs/functions/createOpenAiUsage.html +9 -6
- package/docs/functions/createVercelAISDKTokenUsage.html +9 -6
- package/docs/functions/initAi.html +9 -6
- package/docs/index.html +12 -6
- package/docs/interfaces/LDAIAgent.html +177 -0
- package/docs/interfaces/LDAIAgentConfig.html +111 -0
- package/docs/interfaces/LDAIClient.html +96 -10
- package/docs/interfaces/LDAIConfig.html +15 -12
- package/docs/interfaces/LDAIConfigTracker.html +21 -18
- package/docs/interfaces/LDMessage.html +11 -8
- package/docs/interfaces/LDModelConfig.html +12 -9
- package/docs/interfaces/LDProviderConfig.html +10 -7
- package/docs/interfaces/LDTokenUsage.html +12 -9
- package/docs/interfaces/VercelAISDKConfig.html +19 -16
- package/docs/interfaces/VercelAISDKMapOptions.html +10 -7
- package/docs/types/LDAIAgentDefaults.html +63 -0
- package/docs/types/LDAIDefaults.html +9 -6
- package/docs/types/VercelAISDKProvider.html +9 -6
- package/package.json +1 -1
- package/src/LDAIClientImpl.ts +146 -12
- package/src/LDAIConfigTrackerImpl.ts +11 -3
- package/src/api/LDAIClient.ts +80 -0
- package/src/api/agents/LDAIAgent.ts +36 -0
- package/src/api/agents/index.ts +1 -0
- package/src/api/index.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LDAIClient | @launchdarkly/server-sdk-ai - v0.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LDAIClient | @launchdarkly/server-sdk-ai - v0.11.0</title><meta name="description" content="Documentation for @launchdarkly/server-sdk-ai"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/search.js" id="tsd-search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
2
|
<div class="tsd-toolbar-contents container">
|
|
3
3
|
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
4
|
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div id="tsd-toolbar-links"></div></div>
|
|
7
7
|
<ul class="results">
|
|
8
8
|
<li class="state loading">Preparing search index...</li>
|
|
9
|
-
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@launchdarkly/server-sdk-ai - v0.
|
|
9
|
+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@launchdarkly/server-sdk-ai - v0.11.0</a></div>
|
|
10
10
|
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
11
|
<div class="container container-main">
|
|
12
12
|
<div class="col-content">
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<ul class="tsd-hierarchy">
|
|
25
25
|
<li><span class="target">LDAIClient</span></li></ul></section><aside class="tsd-sources">
|
|
26
26
|
<ul>
|
|
27
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
27
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/3db2700/packages/sdk/server-ai/src/api/LDAIClient.ts#L9">api/LDAIClient.ts:9</a></li></ul></aside>
|
|
28
28
|
<section class="tsd-panel-group tsd-index-group">
|
|
29
29
|
<section class="tsd-panel tsd-index-panel">
|
|
30
30
|
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
|
|
@@ -32,12 +32,93 @@
|
|
|
32
32
|
<div class="tsd-accordion-details">
|
|
33
33
|
<section class="tsd-index-section">
|
|
34
34
|
<h3 class="tsd-index-heading">Methods</h3>
|
|
35
|
-
<div class="tsd-index-list"><a href="LDAIClient.html#
|
|
35
|
+
<div class="tsd-index-list"><a href="LDAIClient.html#agent" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-2048"><rect fill="var(--color-icon-background)" stroke="#FF4DB8" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)"></path></g></svg><span>agent</span></a>
|
|
36
|
+
<a href="LDAIClient.html#agents" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>agents</span></a>
|
|
37
|
+
<a href="LDAIClient.html#config" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>config</span></a>
|
|
36
38
|
</div></section></div></details></section></section>
|
|
37
39
|
<section class="tsd-panel-group tsd-member-group">
|
|
38
40
|
<h2>Methods</h2>
|
|
41
|
+
<section class="tsd-panel tsd-member"><a id="agent" class="tsd-anchor"></a>
|
|
42
|
+
<h3 class="tsd-anchor-link"><span>agent</span><a href="#agent" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" id="icon-anchor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></svg></a></h3>
|
|
43
|
+
<ul class="tsd-signatures">
|
|
44
|
+
<li class="tsd-signature tsd-anchor-link" id="agent.agent-1"><span class="tsd-kind-call-signature">agent</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">key</span>, <span class="tsd-kind-parameter">context</span>, <span class="tsd-kind-parameter">defaultValue</span>, <span class="tsd-kind-parameter">variables</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><a href="LDAIAgent.html" class="tsd-signature-type tsd-kind-interface">LDAIAgent</a><span class="tsd-signature-symbol">></span><a href="#agent.agent-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
45
|
+
<li class="tsd-description">
|
|
46
|
+
<div class="tsd-comment tsd-typography"><p>Retrieves and processes a single AI Config agent based on the provided key, LaunchDarkly context,
|
|
47
|
+
and variables. This includes the model configuration and the customized instructions.</p>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="tsd-parameters">
|
|
50
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
51
|
+
<ul class="tsd-parameter-list">
|
|
52
|
+
<li>
|
|
53
|
+
<h5><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span></h5>
|
|
54
|
+
<div class="tsd-comment tsd-typography"><p>The key of the AI Config agent.</p>
|
|
55
|
+
</div></li>
|
|
56
|
+
<li>
|
|
57
|
+
<h5><span class="tsd-kind-parameter">context</span>: <span class="tsd-signature-type ">LDContext</span></h5>
|
|
58
|
+
<div class="tsd-comment tsd-typography"><p>The LaunchDarkly context object that contains relevant information about the
|
|
59
|
+
current environment, user, or session. This context may influence how the configuration is
|
|
60
|
+
processed or personalized.</p>
|
|
61
|
+
</div></li>
|
|
62
|
+
<li>
|
|
63
|
+
<h5><span class="tsd-kind-parameter">defaultValue</span>: <a href="../types/LDAIAgentDefaults.html" class="tsd-signature-type tsd-kind-type-alias">LDAIAgentDefaults</a></h5>
|
|
64
|
+
<div class="tsd-comment tsd-typography"><p>A fallback value containing model configuration and instructions.</p>
|
|
65
|
+
</div></li>
|
|
66
|
+
<li>
|
|
67
|
+
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">variables</span>: <span class="tsd-signature-type ">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span></h5>
|
|
68
|
+
<div class="tsd-comment tsd-typography"><p>A map of key-value pairs representing dynamic variables to be injected into
|
|
69
|
+
the instructions. The keys correspond to placeholders within the template, and the values
|
|
70
|
+
are the corresponding replacements.</p>
|
|
71
|
+
</div><code class="tsd-tag ts-flagOptional">Optional</code> </li></ul></div>
|
|
72
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><a href="LDAIAgent.html" class="tsd-signature-type tsd-kind-interface">LDAIAgent</a><span class="tsd-signature-symbol">></span></h4><p>An AI agent with customized <code>instructions</code> and a <code>tracker</code>. If the configuration
|
|
73
|
+
cannot be accessed from LaunchDarkly, then the return value will include information from the
|
|
74
|
+
<code>defaultValue</code>. The returned <code>tracker</code> can be used to track AI operation metrics (latency, token usage, etc.).</p>
|
|
75
|
+
|
|
76
|
+
<div class="tsd-comment tsd-typography">
|
|
77
|
+
<h4>Example</h4><pre><code><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">key</span><span class="hl-1"> = </span><span class="hl-3">"research_agent"</span><span class="hl-1">;</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">context</span><span class="hl-1"> = {...};</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">variables</span><span class="hl-1"> = { </span><span class="hl-4">topic:</span><span class="hl-1"> </span><span class="hl-3">'climate change'</span><span class="hl-1"> };</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">agent</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-6">agent</span><span class="hl-1">(</span><span class="hl-4">key</span><span class="hl-1">, </span><span class="hl-4">context</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">enabled:</span><span class="hl-1"> </span><span class="hl-0">true</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">instructions:</span><span class="hl-1"> </span><span class="hl-3">'You are a research assistant.'</span><span class="hl-1">,</span><br/><span class="hl-1">}, </span><span class="hl-4">variables</span><span class="hl-1">);</span><br/><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">researchResult</span><span class="hl-1"> = </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-4">instructions</span><span class="hl-1">; </span><span class="hl-7">// Interpolated instructions</span><br/><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-4">tracker</span><span class="hl-1">.</span><span class="hl-6">trackSuccess</span><span class="hl-1">();</span>
|
|
78
|
+
</code><button>Copy</button></pre>
|
|
79
|
+
</div><aside class="tsd-sources">
|
|
80
|
+
<ul>
|
|
81
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/3db2700/packages/sdk/server-ai/src/api/LDAIClient.ts#L99">api/LDAIClient.ts:99</a></li></ul></aside></li></ul></section>
|
|
82
|
+
<section class="tsd-panel tsd-member"><a id="agents" class="tsd-anchor"></a>
|
|
83
|
+
<h3 class="tsd-anchor-link"><span>agents</span><a href="#agents" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
84
|
+
<ul class="tsd-signatures">
|
|
85
|
+
<li class="tsd-signature tsd-anchor-link" id="agents.agents-1"><span class="tsd-kind-call-signature">agents</span><span class="tsd-signature-symbol"><</span>const <span class="tsd-signature-type tsd-kind-type-parameter">T</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">agentConfigs</span>, <span class="tsd-kind-parameter">context</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type ">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">T</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"key"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">, </span><a href="LDAIAgent.html" class="tsd-signature-type tsd-kind-interface">LDAIAgent</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#agents.agents-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
86
|
+
<li class="tsd-description">
|
|
87
|
+
<div class="tsd-comment tsd-typography"><p>Retrieves and processes multiple AI Config agents based on the provided agent configurations
|
|
88
|
+
and LaunchDarkly context. This includes the model configuration and the customized instructions.</p>
|
|
89
|
+
</div>
|
|
90
|
+
<section class="tsd-panel">
|
|
91
|
+
<h4>Type Parameters</h4>
|
|
92
|
+
<ul class="tsd-type-parameter-list">
|
|
93
|
+
<li>
|
|
94
|
+
<h4>const <span class="tsd-kind-type-parameter">T</span><span class="tsd-signature-symbol"> extends </span><span class="tsd-signature-symbol">readonly </span><a href="LDAIAgentConfig.html" class="tsd-signature-type tsd-kind-interface">LDAIAgentConfig</a><span class="tsd-signature-symbol">[]</span></h4></li></ul></section>
|
|
95
|
+
<div class="tsd-parameters">
|
|
96
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
97
|
+
<ul class="tsd-parameter-list">
|
|
98
|
+
<li>
|
|
99
|
+
<h5><span class="tsd-kind-parameter">agentConfigs</span>: <span class="tsd-signature-type tsd-kind-type-parameter">T</span></h5>
|
|
100
|
+
<div class="tsd-comment tsd-typography"><p>An array of agent configurations, each containing the agent key, default configuration,
|
|
101
|
+
and variables for instructions interpolation.</p>
|
|
102
|
+
</div></li>
|
|
103
|
+
<li>
|
|
104
|
+
<h5><span class="tsd-kind-parameter">context</span>: <span class="tsd-signature-type ">LDContext</span></h5>
|
|
105
|
+
<div class="tsd-comment tsd-typography"><p>The LaunchDarkly context object that contains relevant information about the
|
|
106
|
+
current environment, user, or session. This context may influence how the configuration is
|
|
107
|
+
processed or personalized.</p>
|
|
108
|
+
</div></li></ul></div>
|
|
109
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type ">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">T</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"key"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">, </span><a href="LDAIAgent.html" class="tsd-signature-type tsd-kind-interface">LDAIAgent</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><p>A map of agent keys to their respective AI agents with customized <code>instructions</code> and <code>tracker</code>.
|
|
110
|
+
If a configuration cannot be accessed from LaunchDarkly, then the return value will include information
|
|
111
|
+
from the respective <code>defaultValue</code>. The returned <code>tracker</code> can be used to track AI operation metrics
|
|
112
|
+
(latency, token usage, etc.).</p>
|
|
113
|
+
|
|
114
|
+
<div class="tsd-comment tsd-typography">
|
|
115
|
+
<h4>Example</h4><pre><code><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">agentConfigs</span><span class="hl-1"> = [</span><br/><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">key:</span><span class="hl-1"> </span><span class="hl-3">'research_agent'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">defaultValue:</span><span class="hl-1"> { </span><span class="hl-4">enabled:</span><span class="hl-1"> </span><span class="hl-0">true</span><span class="hl-1">, </span><span class="hl-4">instructions:</span><span class="hl-1"> </span><span class="hl-3">'You are a research assistant.'</span><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">variables:</span><span class="hl-1"> { </span><span class="hl-4">topic:</span><span class="hl-1"> </span><span class="hl-3">'climate change'</span><span class="hl-1"> }</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">key:</span><span class="hl-1"> </span><span class="hl-3">'writing_agent'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">defaultValue:</span><span class="hl-1"> { </span><span class="hl-4">enabled:</span><span class="hl-1"> </span><span class="hl-0">true</span><span class="hl-1">, </span><span class="hl-4">instructions:</span><span class="hl-1"> </span><span class="hl-3">'You are a writing assistant.'</span><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">variables:</span><span class="hl-1"> { </span><span class="hl-4">style:</span><span class="hl-1"> </span><span class="hl-3">'academic'</span><span class="hl-1"> }</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">] </span><span class="hl-5">as</span><span class="hl-1"> </span><span class="hl-0">const</span><span class="hl-1">;</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">context</span><span class="hl-1"> = {...};</span><br/><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">agents</span><span class="hl-1"> = </span><span class="hl-5">await</span><span class="hl-1"> </span><span class="hl-4">client</span><span class="hl-1">.</span><span class="hl-6">agents</span><span class="hl-1">(</span><span class="hl-4">agentConfigs</span><span class="hl-1">, </span><span class="hl-4">context</span><span class="hl-1">);</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">researchResult</span><span class="hl-1"> = </span><span class="hl-4">agents</span><span class="hl-1">[</span><span class="hl-3">"research_agent"</span><span class="hl-1">].</span><span class="hl-4">instructions</span><span class="hl-1">; </span><span class="hl-7">// Interpolated instructions</span><br/><span class="hl-4">agents</span><span class="hl-1">[</span><span class="hl-3">"research_agent"</span><span class="hl-1">].</span><span class="hl-4">tracker</span><span class="hl-1">.</span><span class="hl-6">trackSuccess</span><span class="hl-1">();</span>
|
|
116
|
+
</code><button>Copy</button></pre>
|
|
117
|
+
</div><aside class="tsd-sources">
|
|
118
|
+
<ul>
|
|
119
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/3db2700/packages/sdk/server-ai/src/api/LDAIClient.ts#L142">api/LDAIClient.ts:142</a></li></ul></aside></li></ul></section>
|
|
39
120
|
<section class="tsd-panel tsd-member"><a id="config" class="tsd-anchor"></a>
|
|
40
|
-
<h3 class="tsd-anchor-link"><span>config</span><a href="#config" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><
|
|
121
|
+
<h3 class="tsd-anchor-link"><span>config</span><a href="#config" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
41
122
|
<ul class="tsd-signatures">
|
|
42
123
|
<li class="tsd-signature tsd-anchor-link" id="config.config-1"><span class="tsd-kind-call-signature">config</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">key</span>, <span class="tsd-kind-parameter">context</span>, <span class="tsd-kind-parameter">defaultValue</span>, <span class="tsd-kind-parameter">variables</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><a href="LDAIConfig.html" class="tsd-signature-type tsd-kind-interface">LDAIConfig</a><span class="tsd-signature-symbol">></span><a href="#config.config-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
43
124
|
<li class="tsd-description">
|
|
@@ -73,11 +154,11 @@ LaunchDarkly, then the return value will include information from the <code>defa
|
|
|
73
154
|
be used to track AI operation metrics (latency, token usage, etc.).</p>
|
|
74
155
|
|
|
75
156
|
<div class="tsd-comment tsd-typography">
|
|
76
|
-
<h4>Example</h4><pre><code><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">key</span><span class="hl-1"> = </span><span class="hl-3">"welcome_prompt"</span><span class="hl-1">;</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">context</span><span class="hl-1"> = {...};</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">variables</span><span class="hl-1"> = {</span><span class="hl-4">username:</span><span class="hl-1"> </span><span class="hl-3">'john'</span><span class="hl-1">};</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">defaultValue</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-4">enabled:</span><span class="hl-1"> </span><span class="hl-0">false</span><span class="hl-1">,</span><br/><span class="hl-1">};</span><br/><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">result</span><span class="hl-1"> = </span><span class="hl-
|
|
157
|
+
<h4>Example</h4><pre><code><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">key</span><span class="hl-1"> = </span><span class="hl-3">"welcome_prompt"</span><span class="hl-1">;</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">context</span><span class="hl-1"> = {...};</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">variables</span><span class="hl-1"> = {</span><span class="hl-4">username:</span><span class="hl-1"> </span><span class="hl-3">'john'</span><span class="hl-1">};</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">defaultValue</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-4">enabled:</span><span class="hl-1"> </span><span class="hl-0">false</span><span class="hl-1">,</span><br/><span class="hl-1">};</span><br/><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">result</span><span class="hl-1"> = </span><span class="hl-6">config</span><span class="hl-1">(</span><span class="hl-4">key</span><span class="hl-1">, </span><span class="hl-4">context</span><span class="hl-1">, </span><span class="hl-4">defaultValue</span><span class="hl-1">, </span><span class="hl-4">variables</span><span class="hl-1">);</span><br/><span class="hl-7">// Output:</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-8">enabled</span><span class="hl-1">: </span><span class="hl-0">true</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-8">config</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-8">modelId</span><span class="hl-1">: </span><span class="hl-3">"gpt-4o"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-8">temperature</span><span class="hl-1">: </span><span class="hl-9">0.2</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-8">maxTokens</span><span class="hl-1">: </span><span class="hl-9">4096</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-8">userDefinedKey</span><span class="hl-1">: </span><span class="hl-3">"myValue"</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-8">messages</span><span class="hl-1">: [</span><br/><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">role:</span><span class="hl-1"> </span><span class="hl-3">"system"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">content:</span><span class="hl-1"> </span><span class="hl-3">"You are an amazing GPT."</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">role:</span><span class="hl-1"> </span><span class="hl-3">"user"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">content:</span><span class="hl-1"> </span><span class="hl-3">"Explain how you're an amazing GPT."</span><br/><span class="hl-1"> }</span><br/><span class="hl-1"> ],</span><br/><span class="hl-1"> </span><span class="hl-8">tracker</span><span class="hl-1">: ...</span><br/><span class="hl-1">}</span>
|
|
77
158
|
</code><button>Copy</button></pre>
|
|
78
159
|
</div><aside class="tsd-sources">
|
|
79
160
|
<ul>
|
|
80
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
161
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/3db2700/packages/sdk/server-ai/src/api/LDAIClient.ts#L61">api/LDAIClient.ts:61</a></li></ul></aside></li></ul></section></section></div>
|
|
81
162
|
<div class="col-sidebar">
|
|
82
163
|
<div class="page-menu">
|
|
83
164
|
<div class="tsd-navigation settings">
|
|
@@ -97,12 +178,16 @@ be used to track AI operation metrics (latency, token usage, etc.).</p>
|
|
|
97
178
|
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg>On This Page</h3></summary>
|
|
98
179
|
<div class="tsd-accordion-details">
|
|
99
180
|
<ul>
|
|
181
|
+
<li><a href="#agent" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>agent</span></a></li>
|
|
182
|
+
<li><a href="#agents" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>agents</span></a></li>
|
|
100
183
|
<li><a href="#config" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>config</span></a></li></ul></div></details></div>
|
|
101
184
|
<div class="site-menu">
|
|
102
|
-
<nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@launchdarkly/server-<wbr/>sdk-<wbr/>ai -<wbr/> v0.
|
|
185
|
+
<nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@launchdarkly/server-<wbr/>sdk-<wbr/>ai -<wbr/> v0.11.0</span></a>
|
|
103
186
|
<ul class="tsd-small-nested-navigation">
|
|
104
187
|
<li><a href="../enums/LDFeedbackKind.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-8"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.45 16V7.24H14.49V8.224H10.518V10.936H14.07V11.908H10.518V15.016H14.49V16H9.45Z" fill="var(--color-text)"></path></g></svg><span>LDFeedback<wbr/>Kind</span></a></li>
|
|
105
|
-
<li><a href="
|
|
188
|
+
<li><a href="LDAIAgent.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g></svg><span>LDAIAgent</span></a></li>
|
|
189
|
+
<li><a href="LDAIAgentConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDAIAgent<wbr/>Config</span></a></li>
|
|
190
|
+
<li><a href="LDAIClient.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDAIClient</span></a></li>
|
|
106
191
|
<li><a href="LDAIConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDAIConfig</span></a></li>
|
|
107
192
|
<li><a href="LDAIConfigTracker.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDAIConfig<wbr/>Tracker</span></a></li>
|
|
108
193
|
<li><a href="LDMessage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDMessage</span></a></li>
|
|
@@ -111,7 +196,8 @@ be used to track AI operation metrics (latency, token usage, etc.).</p>
|
|
|
111
196
|
<li><a href="LDTokenUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDToken<wbr/>Usage</span></a></li>
|
|
112
197
|
<li><a href="VercelAISDKConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>VercelAISDKConfig</span></a></li>
|
|
113
198
|
<li><a href="VercelAISDKMapOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>VercelAISDKMap<wbr/>Options</span></a></li>
|
|
114
|
-
<li><a href="../types/
|
|
199
|
+
<li><a href="../types/LDAIAgentDefaults.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-2097152"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>LDAIAgent<wbr/>Defaults</span></a></li>
|
|
200
|
+
<li><a href="../types/LDAIDefaults.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2097152"></use></svg><span>LDAIDefaults</span></a></li>
|
|
115
201
|
<li><a href="../types/VercelAISDKProvider.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2097152"></use></svg><span>VercelAISDKProvider</span></a></li>
|
|
116
202
|
<li><a href="../functions/createBedrockTokenUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g></svg><span>create<wbr/>Bedrock<wbr/>Token<wbr/>Usage</span></a></li>
|
|
117
203
|
<li><a href="../functions/createOpenAiUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>create<wbr/>Open<wbr/>Ai<wbr/>Usage</span></a></li>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LDAIConfig | @launchdarkly/server-sdk-ai - v0.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LDAIConfig | @launchdarkly/server-sdk-ai - v0.11.0</title><meta name="description" content="Documentation for @launchdarkly/server-sdk-ai"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/search.js" id="tsd-search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
2
|
<div class="tsd-toolbar-contents container">
|
|
3
3
|
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
4
|
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div id="tsd-toolbar-links"></div></div>
|
|
7
7
|
<ul class="results">
|
|
8
8
|
<li class="state loading">Preparing search index...</li>
|
|
9
|
-
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@launchdarkly/server-sdk-ai - v0.
|
|
9
|
+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@launchdarkly/server-sdk-ai - v0.11.0</a></div>
|
|
10
10
|
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
11
|
<div class="container container-main">
|
|
12
12
|
<div class="col-content">
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<ul class="tsd-hierarchy">
|
|
25
25
|
<li><span class="target">LDAIConfig</span></li></ul></section><aside class="tsd-sources">
|
|
26
26
|
<ul>
|
|
27
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
27
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/3db2700/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L48">api/config/LDAIConfig.ts:48</a></li></ul></aside>
|
|
28
28
|
<section class="tsd-panel-group tsd-index-group">
|
|
29
29
|
<section class="tsd-panel tsd-index-panel">
|
|
30
30
|
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
</div>
|
|
49
49
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
50
50
|
<ul>
|
|
51
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
51
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/3db2700/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L71">api/config/LDAIConfig.ts:71</a></li></ul></aside></section>
|
|
52
52
|
<section class="tsd-panel tsd-member"><a id="messages" class="tsd-anchor"></a>
|
|
53
53
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>messages</span><a href="#messages" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
54
54
|
<div class="tsd-signature"><span class="tsd-kind-property">messages</span><span class="tsd-signature-symbol">?:</span> <a href="LDMessage.html" class="tsd-signature-type tsd-kind-interface">LDMessage</a><span class="tsd-signature-symbol">[]</span></div>
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
</div>
|
|
57
57
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
58
58
|
<ul>
|
|
59
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
59
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/3db2700/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L56">api/config/LDAIConfig.ts:56</a></li></ul></aside></section>
|
|
60
60
|
<section class="tsd-panel tsd-member"><a id="model" class="tsd-anchor"></a>
|
|
61
61
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>model</span><a href="#model" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
62
62
|
<div class="tsd-signature"><span class="tsd-kind-property">model</span><span class="tsd-signature-symbol">?:</span> <a href="LDModelConfig.html" class="tsd-signature-type tsd-kind-interface">LDModelConfig</a></div>
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
</div>
|
|
65
65
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
66
66
|
<ul>
|
|
67
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
67
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/3db2700/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L52">api/config/LDAIConfig.ts:52</a></li></ul></aside></section>
|
|
68
68
|
<section class="tsd-panel tsd-member"><a id="provider" class="tsd-anchor"></a>
|
|
69
69
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>provider</span><a href="#provider" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
70
70
|
<div class="tsd-signature"><span class="tsd-kind-property">provider</span><span class="tsd-signature-symbol">?:</span> <a href="LDProviderConfig.html" class="tsd-signature-type tsd-kind-interface">LDProviderConfig</a></div>
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
</div>
|
|
73
73
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
74
74
|
<ul>
|
|
75
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
75
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/3db2700/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L61">api/config/LDAIConfig.ts:61</a></li></ul></aside></section>
|
|
76
76
|
<section class="tsd-panel tsd-member"><a id="toVercelAISDK" class="tsd-anchor"></a>
|
|
77
77
|
<h3 class="tsd-anchor-link"><span>to<wbr/>VercelAISDK</span><a href="#toVercelAISDK" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
78
78
|
<div class="tsd-signature"><span class="tsd-kind-property">to<wbr/>VercelAISDK</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TMod</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">provider</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><a href="VercelAISDKConfig.html" class="tsd-signature-type tsd-kind-interface">VercelAISDKConfig</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TMod</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span></div>
|
|
@@ -109,7 +109,7 @@ and streamText() methods.</p>
|
|
|
109
109
|
<h4>Throws</h4><p>if a Vercel AI SDK model cannot be determined from the given provider parameter.</p>
|
|
110
110
|
</div></li></ul></li></ul></div><aside class="tsd-sources">
|
|
111
111
|
<ul>
|
|
112
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
112
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/3db2700/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L84">api/config/LDAIConfig.ts:84</a></li></ul></aside></section>
|
|
113
113
|
<section class="tsd-panel tsd-member"><a id="tracker" class="tsd-anchor"></a>
|
|
114
114
|
<h3 class="tsd-anchor-link"><span>tracker</span><a href="#tracker" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
115
115
|
<div class="tsd-signature"><span class="tsd-kind-property">tracker</span><span class="tsd-signature-symbol">:</span> <a href="LDAIConfigTracker.html" class="tsd-signature-type tsd-kind-interface">LDAIConfigTracker</a></div>
|
|
@@ -117,7 +117,7 @@ and streamText() methods.</p>
|
|
|
117
117
|
</div>
|
|
118
118
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
119
119
|
<ul>
|
|
120
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
120
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/3db2700/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L66">api/config/LDAIConfig.ts:66</a></li></ul></aside></section></section></div>
|
|
121
121
|
<div class="col-sidebar">
|
|
122
122
|
<div class="page-menu">
|
|
123
123
|
<div class="tsd-navigation settings">
|
|
@@ -144,10 +144,12 @@ and streamText() methods.</p>
|
|
|
144
144
|
<li><a href="#toVercelAISDK" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>to<wbr/>VercelAISDK</span></a></li>
|
|
145
145
|
<li><a href="#tracker" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>tracker</span></a></li></ul></div></details></div>
|
|
146
146
|
<div class="site-menu">
|
|
147
|
-
<nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@launchdarkly/server-<wbr/>sdk-<wbr/>ai -<wbr/> v0.
|
|
147
|
+
<nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@launchdarkly/server-<wbr/>sdk-<wbr/>ai -<wbr/> v0.11.0</span></a>
|
|
148
148
|
<ul class="tsd-small-nested-navigation">
|
|
149
149
|
<li><a href="../enums/LDFeedbackKind.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-8"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.45 16V7.24H14.49V8.224H10.518V10.936H14.07V11.908H10.518V15.016H14.49V16H9.45Z" fill="var(--color-text)"></path></g></svg><span>LDFeedback<wbr/>Kind</span></a></li>
|
|
150
|
-
<li><a href="
|
|
150
|
+
<li><a href="LDAIAgent.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g></svg><span>LDAIAgent</span></a></li>
|
|
151
|
+
<li><a href="LDAIAgentConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDAIAgent<wbr/>Config</span></a></li>
|
|
152
|
+
<li><a href="LDAIClient.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDAIClient</span></a></li>
|
|
151
153
|
<li><a href="LDAIConfig.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDAIConfig</span></a></li>
|
|
152
154
|
<li><a href="LDAIConfigTracker.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDAIConfig<wbr/>Tracker</span></a></li>
|
|
153
155
|
<li><a href="LDMessage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDMessage</span></a></li>
|
|
@@ -156,7 +158,8 @@ and streamText() methods.</p>
|
|
|
156
158
|
<li><a href="LDTokenUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDToken<wbr/>Usage</span></a></li>
|
|
157
159
|
<li><a href="VercelAISDKConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>VercelAISDKConfig</span></a></li>
|
|
158
160
|
<li><a href="VercelAISDKMapOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>VercelAISDKMap<wbr/>Options</span></a></li>
|
|
159
|
-
<li><a href="../types/
|
|
161
|
+
<li><a href="../types/LDAIAgentDefaults.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-2097152"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>LDAIAgent<wbr/>Defaults</span></a></li>
|
|
162
|
+
<li><a href="../types/LDAIDefaults.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2097152"></use></svg><span>LDAIDefaults</span></a></li>
|
|
160
163
|
<li><a href="../types/VercelAISDKProvider.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2097152"></use></svg><span>VercelAISDKProvider</span></a></li>
|
|
161
164
|
<li><a href="../functions/createBedrockTokenUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g></svg><span>create<wbr/>Bedrock<wbr/>Token<wbr/>Usage</span></a></li>
|
|
162
165
|
<li><a href="../functions/createOpenAiUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>create<wbr/>Open<wbr/>Ai<wbr/>Usage</span></a></li>
|