@launchdarkly/server-sdk-ai 0.10.1 → 0.11.2

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 (54) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/__tests__/LDAIClientImpl.test.ts +235 -1
  3. package/__tests__/LDAIConfigTrackerImpl.test.ts +94 -136
  4. package/dist/LDAIClientImpl.d.ts +7 -0
  5. package/dist/LDAIClientImpl.d.ts.map +1 -1
  6. package/dist/LDAIClientImpl.js +60 -11
  7. package/dist/LDAIClientImpl.js.map +1 -1
  8. package/dist/LDAIConfigTrackerImpl.d.ts +3 -1
  9. package/dist/LDAIConfigTrackerImpl.d.ts.map +1 -1
  10. package/dist/LDAIConfigTrackerImpl.js +5 -3
  11. package/dist/LDAIConfigTrackerImpl.js.map +1 -1
  12. package/dist/api/LDAIClient.d.ts +70 -0
  13. package/dist/api/LDAIClient.d.ts.map +1 -1
  14. package/dist/api/agents/LDAIAgent.d.ts +32 -0
  15. package/dist/api/agents/LDAIAgent.d.ts.map +1 -0
  16. package/dist/api/agents/LDAIAgent.js +3 -0
  17. package/dist/api/agents/LDAIAgent.js.map +1 -0
  18. package/dist/api/agents/index.d.ts +2 -0
  19. package/dist/api/agents/index.d.ts.map +1 -0
  20. package/dist/api/agents/index.js +18 -0
  21. package/dist/api/agents/index.js.map +1 -0
  22. package/dist/api/index.d.ts +1 -0
  23. package/dist/api/index.d.ts.map +1 -1
  24. package/dist/api/index.js +1 -0
  25. package/dist/api/index.js.map +1 -1
  26. package/docs/assets/highlight.css +15 -8
  27. package/docs/assets/search.js +1 -1
  28. package/docs/enums/LDFeedbackKind.html +11 -8
  29. package/docs/functions/createBedrockTokenUsage.html +9 -6
  30. package/docs/functions/createOpenAiUsage.html +9 -6
  31. package/docs/functions/createVercelAISDKTokenUsage.html +9 -6
  32. package/docs/functions/initAi.html +9 -6
  33. package/docs/index.html +12 -6
  34. package/docs/interfaces/LDAIAgent.html +137 -0
  35. package/docs/interfaces/LDAIAgentConfig.html +111 -0
  36. package/docs/interfaces/LDAIClient.html +96 -10
  37. package/docs/interfaces/LDAIConfig.html +15 -12
  38. package/docs/interfaces/LDAIConfigTracker.html +21 -18
  39. package/docs/interfaces/LDMessage.html +11 -8
  40. package/docs/interfaces/LDModelConfig.html +12 -9
  41. package/docs/interfaces/LDProviderConfig.html +10 -7
  42. package/docs/interfaces/LDTokenUsage.html +12 -9
  43. package/docs/interfaces/VercelAISDKConfig.html +19 -16
  44. package/docs/interfaces/VercelAISDKMapOptions.html +10 -7
  45. package/docs/types/LDAIAgentDefaults.html +63 -0
  46. package/docs/types/LDAIDefaults.html +9 -6
  47. package/docs/types/VercelAISDKProvider.html +9 -6
  48. package/package.json +1 -1
  49. package/src/LDAIClientImpl.ts +141 -12
  50. package/src/LDAIConfigTrackerImpl.ts +11 -3
  51. package/src/api/LDAIClient.ts +80 -0
  52. package/src/api/agents/LDAIAgent.ts +36 -0
  53. package/src/api/agents/index.ts +1 -0
  54. package/src/api/index.ts +1 -0
@@ -0,0 +1,137 @@
1
+ <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LDAIAgent | @launchdarkly/server-sdk-ai - v0.11.2</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
+ <div class="tsd-toolbar-contents container">
3
+ <div class="table-cell" id="tsd-search" data-base="..">
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>
5
+ <div class="field">
6
+ <div id="tsd-toolbar-links"></div></div>
7
+ <ul class="results">
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.11.2</a></div>
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
+ <div class="container container-main">
12
+ <div class="col-content">
13
+ <div class="tsd-page-title">
14
+ <ul class="tsd-breadcrumb">
15
+ <li><a href="../index.html">@launchdarkly/server-sdk-ai</a></li>
16
+ <li><a href="LDAIAgent.html">LDAIAgent</a></li></ul>
17
+ <h1>Interface LDAIAgent</h1></div>
18
+ <section class="tsd-panel tsd-comment">
19
+ <div class="tsd-comment tsd-typography"><p>AI Config agent and tracker.</p>
20
+ </div>
21
+ <div class="tsd-comment tsd-typography"></div></section>
22
+ <section class="tsd-panel tsd-hierarchy">
23
+ <h4>Hierarchy</h4>
24
+ <ul class="tsd-hierarchy">
25
+ <li><span class="tsd-signature-type ">Omit</span><span class="tsd-signature-symbol">&lt;</span><a href="LDAIConfig.html" class="tsd-signature-type tsd-kind-interface">LDAIConfig</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">&quot;messages&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;toVercelAISDK&quot;</span><span class="tsd-signature-symbol">&gt;</span>
26
+ <ul class="tsd-hierarchy">
27
+ <li><span class="target">LDAIAgent</span></li></ul></li></ul></section><aside class="tsd-sources">
28
+ <ul>
29
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/de783b9/packages/sdk/server-ai/src/api/agents/LDAIAgent.ts#L6">api/agents/LDAIAgent.ts:6</a></li></ul></aside>
30
+ <section class="tsd-panel-group tsd-index-group">
31
+ <section class="tsd-panel tsd-index-panel">
32
+ <details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
33
+ <h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex=0><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-text)"></path></svg> Index</h5></summary>
34
+ <div class="tsd-accordion-details">
35
+ <section class="tsd-index-section">
36
+ <h3 class="tsd-index-heading">Properties</h3>
37
+ <div class="tsd-index-list"><a href="LDAIAgent.html#enabled" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-1024"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g></svg><span>enabled</span></a>
38
+ <a href="LDAIAgent.html#instructions" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>instructions?</span></a>
39
+ <a href="LDAIAgent.html#model" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>model?</span></a>
40
+ <a href="LDAIAgent.html#provider" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>provider?</span></a>
41
+ <a href="LDAIAgent.html#tracker" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>tracker</span></a>
42
+ </div></section></div></details></section></section>
43
+ <section class="tsd-panel-group tsd-member-group">
44
+ <h2>Properties</h2>
45
+ <section class="tsd-panel tsd-member tsd-is-inherited"><a id="enabled" class="tsd-anchor"></a>
46
+ <h3 class="tsd-anchor-link"><span>enabled</span><a href="#enabled" 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>
47
+ <div class="tsd-signature"><span class="tsd-kind-property">enabled</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
48
+ <div class="tsd-comment tsd-typography"><p>Whether the configuration is enabled.</p>
49
+ </div>
50
+ <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
51
+ <p>Inherited from Omit.enabled</p>
52
+ <ul>
53
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/de783b9/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L71">api/config/LDAIConfig.ts:71</a></li></ul></aside></section>
54
+ <section class="tsd-panel tsd-member"><a id="instructions" class="tsd-anchor"></a>
55
+ <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>instructions</span><a href="#instructions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
56
+ <div class="tsd-signature"><span class="tsd-kind-property">instructions</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div>
57
+ <div class="tsd-comment tsd-typography"><p>Instructions for the agent.</p>
58
+ </div>
59
+ <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
60
+ <ul>
61
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/de783b9/packages/sdk/server-ai/src/api/agents/LDAIAgent.ts#L10">api/agents/LDAIAgent.ts:10</a></li></ul></aside></section>
62
+ <section class="tsd-panel tsd-member tsd-is-inherited"><a id="model" class="tsd-anchor"></a>
63
+ <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>
64
+ <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>
65
+ <div class="tsd-comment tsd-typography"><p>Optional model configuration.</p>
66
+ </div>
67
+ <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
68
+ <p>Inherited from Omit.model</p>
69
+ <ul>
70
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/de783b9/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L52">api/config/LDAIConfig.ts:52</a></li></ul></aside></section>
71
+ <section class="tsd-panel tsd-member tsd-is-inherited"><a id="provider" class="tsd-anchor"></a>
72
+ <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>
73
+ <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>
74
+ <div class="tsd-comment tsd-typography"><p>Optional configuration for the provider.</p>
75
+ </div>
76
+ <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
77
+ <p>Inherited from Omit.provider</p>
78
+ <ul>
79
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/de783b9/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L61">api/config/LDAIConfig.ts:61</a></li></ul></aside></section>
80
+ <section class="tsd-panel tsd-member tsd-is-inherited"><a id="tracker" class="tsd-anchor"></a>
81
+ <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>
82
+ <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>
83
+ <div class="tsd-comment tsd-typography"><p>A tracker which can be used to generate analytics.</p>
84
+ </div>
85
+ <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
86
+ <p>Inherited from Omit.tracker</p>
87
+ <ul>
88
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/de783b9/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L66">api/config/LDAIConfig.ts:66</a></li></ul></aside></section></section></div>
89
+ <div class="col-sidebar">
90
+ <div class="page-menu">
91
+ <div class="tsd-navigation settings">
92
+ <details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
93
+ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)" id="icon-chevronDown"></path></svg>Settings</h3></summary>
94
+ <div class="tsd-accordion-details">
95
+ <div class="tsd-filter-visibility">
96
+ <h4 class="uppercase">Member Visibility</h4><form>
97
+ <ul id="tsd-filter-options">
98
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
99
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
100
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
101
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
102
+ <div class="tsd-theme-toggle">
103
+ <h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
104
+ <details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary">
105
+ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg>On This Page</h3></summary>
106
+ <div class="tsd-accordion-details">
107
+ <ul>
108
+ <li><a href="#enabled" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>enabled</span></a></li>
109
+ <li><a href="#instructions" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>instructions</span></a></li>
110
+ <li><a href="#model" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>model</span></a></li>
111
+ <li><a href="#provider" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>provider</span></a></li>
112
+ <li><a href="#tracker" class="tsd-is-inherited"><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>
113
+ <div class="site-menu">
114
+ <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.2</span></a>
115
+ <ul class="tsd-small-nested-navigation">
116
+ <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>
117
+ <li><a href="LDAIAgent.html" class="current"><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>
118
+ <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>
119
+ <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>
120
+ <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>
121
+ <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>
122
+ <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>
123
+ <li><a href="LDModelConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDModel<wbr/>Config</span></a></li>
124
+ <li><a href="LDProviderConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDProvider<wbr/>Config</span></a></li>
125
+ <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>
126
+ <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>
127
+ <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>
128
+ <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>
129
+ <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>
130
+ <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>
131
+ <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>
132
+ <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>
133
+ <li><a href="../functions/createVercelAISDKTokenUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>create<wbr/>VercelAISDKToken<wbr/>Usage</span></a></li>
134
+ <li><a href="../functions/initAi.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>init<wbr/>Ai</span></a></li></ul></nav></div></div></div>
135
+ <div class="tsd-generator">
136
+ <p>Generated using <a href="https://typedoc.org/" rel="noopener" target="_blank">TypeDoc</a></p></div>
137
+ <div class="overlay"></div></body></html>
@@ -0,0 +1,111 @@
1
+ <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LDAIAgentConfig | @launchdarkly/server-sdk-ai - v0.11.2</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
+ <div class="tsd-toolbar-contents container">
3
+ <div class="table-cell" id="tsd-search" data-base="..">
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>
5
+ <div class="field">
6
+ <div id="tsd-toolbar-links"></div></div>
7
+ <ul class="results">
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.11.2</a></div>
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
+ <div class="container container-main">
12
+ <div class="col-content">
13
+ <div class="tsd-page-title">
14
+ <ul class="tsd-breadcrumb">
15
+ <li><a href="../index.html">@launchdarkly/server-sdk-ai</a></li>
16
+ <li><a href="LDAIAgentConfig.html">LDAIAgentConfig</a></li></ul>
17
+ <h1>Interface LDAIAgentConfig</h1></div>
18
+ <section class="tsd-panel tsd-comment">
19
+ <div class="tsd-comment tsd-typography"><p>Configuration for a single agent request.</p>
20
+ </div>
21
+ <div class="tsd-comment tsd-typography"></div></section>
22
+ <section class="tsd-panel tsd-hierarchy">
23
+ <h4>Hierarchy</h4>
24
+ <ul class="tsd-hierarchy">
25
+ <li><span class="target">LDAIAgentConfig</span></li></ul></section><aside class="tsd-sources">
26
+ <ul>
27
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/de783b9/packages/sdk/server-ai/src/api/agents/LDAIAgent.ts#L16">api/agents/LDAIAgent.ts:16</a></li></ul></aside>
28
+ <section class="tsd-panel-group tsd-index-group">
29
+ <section class="tsd-panel tsd-index-panel">
30
+ <details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
31
+ <h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex=0><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-text)"></path></svg> Index</h5></summary>
32
+ <div class="tsd-accordion-details">
33
+ <section class="tsd-index-section">
34
+ <h3 class="tsd-index-heading">Properties</h3>
35
+ <div class="tsd-index-list"><a href="LDAIAgentConfig.html#defaultValue" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-1024"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g></svg><span>default<wbr/>Value</span></a>
36
+ <a href="LDAIAgentConfig.html#key" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>key</span></a>
37
+ <a href="LDAIAgentConfig.html#variables" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>variables?</span></a>
38
+ </div></section></div></details></section></section>
39
+ <section class="tsd-panel-group tsd-member-group">
40
+ <h2>Properties</h2>
41
+ <section class="tsd-panel tsd-member"><a id="defaultValue" class="tsd-anchor"></a>
42
+ <h3 class="tsd-anchor-link"><span>default<wbr/>Value</span><a href="#defaultValue" 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
+ <div class="tsd-signature"><span class="tsd-kind-property">default<wbr/>Value</span><span class="tsd-signature-symbol">:</span> <a href="../types/LDAIAgentDefaults.html" class="tsd-signature-type tsd-kind-type-alias">LDAIAgentDefaults</a></div>
44
+ <div class="tsd-comment tsd-typography"><p>Default configuration for the agent.</p>
45
+ </div>
46
+ <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
47
+ <ul>
48
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/de783b9/packages/sdk/server-ai/src/api/agents/LDAIAgent.ts#L25">api/agents/LDAIAgent.ts:25</a></li></ul></aside></section>
49
+ <section class="tsd-panel tsd-member"><a id="key" class="tsd-anchor"></a>
50
+ <h3 class="tsd-anchor-link"><span>key</span><a href="#key" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
51
+ <div class="tsd-signature"><span class="tsd-kind-property">key</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
52
+ <div class="tsd-comment tsd-typography"><p>The agent key to retrieve.</p>
53
+ </div>
54
+ <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
55
+ <ul>
56
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/de783b9/packages/sdk/server-ai/src/api/agents/LDAIAgent.ts#L20">api/agents/LDAIAgent.ts:20</a></li></ul></aside></section>
57
+ <section class="tsd-panel tsd-member"><a id="variables" class="tsd-anchor"></a>
58
+ <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>variables</span><a href="#variables" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
59
+ <div class="tsd-signature"><span class="tsd-kind-property">variables</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type ">Record</span><span class="tsd-signature-symbol">&lt;</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">&gt;</span></div>
60
+ <div class="tsd-comment tsd-typography"><p>Variables for instructions interpolation.</p>
61
+ </div>
62
+ <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
63
+ <ul>
64
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/de783b9/packages/sdk/server-ai/src/api/agents/LDAIAgent.ts#L30">api/agents/LDAIAgent.ts:30</a></li></ul></aside></section></section></div>
65
+ <div class="col-sidebar">
66
+ <div class="page-menu">
67
+ <div class="tsd-navigation settings">
68
+ <details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
69
+ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)" id="icon-chevronDown"></path></svg>Settings</h3></summary>
70
+ <div class="tsd-accordion-details">
71
+ <div class="tsd-filter-visibility">
72
+ <h4 class="uppercase">Member Visibility</h4><form>
73
+ <ul id="tsd-filter-options">
74
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
75
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
76
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
77
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
78
+ <div class="tsd-theme-toggle">
79
+ <h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
80
+ <details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary">
81
+ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg>On This Page</h3></summary>
82
+ <div class="tsd-accordion-details">
83
+ <ul>
84
+ <li><a href="#defaultValue" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>default<wbr/>Value</span></a></li>
85
+ <li><a href="#key" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>key</span></a></li>
86
+ <li><a href="#variables" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>variables</span></a></li></ul></div></details></div>
87
+ <div class="site-menu">
88
+ <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.2</span></a>
89
+ <ul class="tsd-small-nested-navigation">
90
+ <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>
91
+ <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>
92
+ <li><a href="LDAIAgentConfig.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDAIAgent<wbr/>Config</span></a></li>
93
+ <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>
94
+ <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>
95
+ <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>
96
+ <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>
97
+ <li><a href="LDModelConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDModel<wbr/>Config</span></a></li>
98
+ <li><a href="LDProviderConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDProvider<wbr/>Config</span></a></li>
99
+ <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>
100
+ <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>
101
+ <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>
102
+ <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>
103
+ <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>
104
+ <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>
105
+ <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>
106
+ <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>
107
+ <li><a href="../functions/createVercelAISDKTokenUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>create<wbr/>VercelAISDKToken<wbr/>Usage</span></a></li>
108
+ <li><a href="../functions/initAi.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>init<wbr/>Ai</span></a></li></ul></nav></div></div></div>
109
+ <div class="tsd-generator">
110
+ <p>Generated using <a href="https://typedoc.org/" rel="noopener" target="_blank">TypeDoc</a></p></div>
111
+ <div class="overlay"></div></body></html>
@@ -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.10.1</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">
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.2</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.10.1</a></div>
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.2</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/f53315c/packages/sdk/server-ai/src/api/LDAIClient.ts#L8">api/LDAIClient.ts:8</a></li></ul></aside>
27
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/de783b9/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#config" 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>config</span></a>
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">&lt;</span><a href="LDAIAgent.html" class="tsd-signature-type tsd-kind-interface">LDAIAgent</a><span class="tsd-signature-symbol">&gt;</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">&lt;</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">&gt;</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">&lt;</span><a href="LDAIAgent.html" class="tsd-signature-type tsd-kind-interface">LDAIAgent</a><span class="tsd-signature-symbol">&gt;</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">&quot;research_agent&quot;</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">&#39;climate change&#39;</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">&#39;You are a research assistant.&#39;</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/de783b9/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">&lt;</span>const <span class="tsd-signature-type tsd-kind-type-parameter">T</span><span class="tsd-signature-symbol">&gt;</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">&lt;</span><span class="tsd-signature-type ">Record</span><span class="tsd-signature-symbol">&lt;</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">&quot;key&quot;</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">&gt;</span><span class="tsd-signature-symbol">&gt;</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">&lt;</span><span class="tsd-signature-type ">Record</span><span class="tsd-signature-symbol">&lt;</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">&quot;key&quot;</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">&gt;</span><span class="tsd-signature-symbol">&gt;</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">&#39;research_agent&#39;</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">&#39;You are a research assistant.&#39;</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">&#39;climate change&#39;</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">&#39;writing_agent&#39;</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">&#39;You are a writing assistant.&#39;</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">&#39;academic&#39;</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">&quot;research_agent&quot;</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">&quot;research_agent&quot;</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/de783b9/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"><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>
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">&lt;</span><a href="LDAIConfig.html" class="tsd-signature-type tsd-kind-interface">LDAIConfig</a><span class="tsd-signature-symbol">&gt;</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">&quot;welcome_prompt&quot;</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">&#39;john&#39;</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-5">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-6">// Output:</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-7">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-7">config</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-7">modelId</span><span class="hl-1">: </span><span class="hl-3">&quot;gpt-4o&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-7">temperature</span><span class="hl-1">: </span><span class="hl-8">0.2</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-7">maxTokens</span><span class="hl-1">: </span><span class="hl-8">4096</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-7">userDefinedKey</span><span class="hl-1">: </span><span class="hl-3">&quot;myValue&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-7">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">&quot;system&quot;</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">&quot;You are an amazing GPT.&quot;</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">&quot;user&quot;</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">&quot;Explain how you&#39;re an amazing GPT.&quot;</span><br/><span class="hl-1"> }</span><br/><span class="hl-1"> ],</span><br/><span class="hl-1"> </span><span class="hl-7">tracker</span><span class="hl-1">: ...</span><br/><span class="hl-1">}</span>
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">&quot;welcome_prompt&quot;</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">&#39;john&#39;</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">&quot;gpt-4o&quot;</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">&quot;myValue&quot;</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">&quot;system&quot;</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">&quot;You are an amazing GPT.&quot;</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">&quot;user&quot;</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">&quot;Explain how you&#39;re an amazing GPT.&quot;</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/f53315c/packages/sdk/server-ai/src/api/LDAIClient.ts#L60">api/LDAIClient.ts:60</a></li></ul></aside></li></ul></section></section></div>
161
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/de783b9/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.10.1</span></a>
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.2</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="LDAIClient.html" class="current"><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>LDAIClient</span></a></li>
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/LDAIDefaults.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>LDAIDefaults</span></a></li>
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>