@@ -7,11 +7,11 @@ import {
77 LDAIAgentConfig ,
88 LDAIAgentConfigDefault ,
99 LDAIAgentRequestConfig ,
10+ LDAICompletionConfig ,
11+ LDAICompletionConfigDefault ,
1012 LDAIConfigDefaultKind ,
1113 LDAIConfigKind ,
1214 LDAIConfigMode ,
13- LDAIConversationConfig ,
14- LDAIConversationConfigDefault ,
1515 LDAIJudgeConfig ,
1616 LDAIJudgeConfigDefault ,
1717 LDJudge ,
@@ -89,10 +89,10 @@ export class LDAIClientImpl implements LDAIClient {
8989 }
9090
9191 private _applyInterpolation (
92- config : LDAIConversationConfig | LDAIAgentConfig | LDAIJudgeConfig ,
92+ config : LDAIConfigKind ,
9393 context : LDContext ,
9494 variables ?: Record < string , unknown > ,
95- ) : LDAIConversationConfig | LDAIAgentConfig | LDAIJudgeConfig {
95+ ) : LDAIConfigKind {
9696 const allVariables = { ...variables , ldctx : context } ;
9797
9898 if ( 'messages' in config && config . messages ) {
@@ -115,7 +115,7 @@ export class LDAIClientImpl implements LDAIClient {
115115 return config ;
116116 }
117117
118- private _addVercelAISDKSupport ( config : LDAIConversationConfig ) : LDAIConversationConfig {
118+ private _addVercelAISDKSupport ( config : LDAICompletionConfig ) : LDAICompletionConfig {
119119 const { messages } = config ;
120120 const mapper = new LDAIConfigMapper ( config . model , config . provider , messages ) ;
121121
@@ -160,13 +160,13 @@ export class LDAIClientImpl implements LDAIClient {
160160 async completionConfig (
161161 key : string ,
162162 context : LDContext ,
163- defaultValue : LDAIConversationConfigDefault ,
163+ defaultValue : LDAICompletionConfigDefault ,
164164 variables ?: Record < string , unknown > ,
165- ) : Promise < LDAIConversationConfig > {
165+ ) : Promise < LDAICompletionConfig > {
166166 this . _ldClient . track ( TRACK_CONFIG_SINGLE , context , key , 1 ) ;
167167
168168 const config = await this . _evaluate ( key , context , defaultValue , 'completion' , variables ) ;
169- return this . _addVercelAISDKSupport ( config as LDAIConversationConfig ) ;
169+ return this . _addVercelAISDKSupport ( config as LDAICompletionConfig ) ;
170170 }
171171
172172 /**
@@ -175,9 +175,9 @@ export class LDAIClientImpl implements LDAIClient {
175175 async config (
176176 key : string ,
177177 context : LDContext ,
178- defaultValue : LDAIConversationConfigDefault ,
178+ defaultValue : LDAICompletionConfigDefault ,
179179 variables ?: Record < string , unknown > ,
180- ) : Promise < LDAIConversationConfig > {
180+ ) : Promise < LDAICompletionConfig > {
181181 return this . completionConfig ( key , context , defaultValue , variables ) ;
182182 }
183183
@@ -254,7 +254,7 @@ export class LDAIClientImpl implements LDAIClient {
254254 async createChat (
255255 key : string ,
256256 context : LDContext ,
257- defaultValue : LDAIConversationConfigDefault ,
257+ defaultValue : LDAICompletionConfigDefault ,
258258 variables ?: Record < string , unknown > ,
259259 defaultAiProvider ?: SupportedAIProvider ,
260260 ) : Promise < TrackedChat | undefined > {
@@ -335,7 +335,7 @@ export class LDAIClientImpl implements LDAIClient {
335335 async initChat (
336336 key : string ,
337337 context : LDContext ,
338- defaultValue : LDAIConversationConfigDefault ,
338+ defaultValue : LDAICompletionConfigDefault ,
339339 variables ?: Record < string , unknown > ,
340340 defaultAiProvider ?: SupportedAIProvider ,
341341 ) : Promise < TrackedChat | undefined > {
0 commit comments