File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,11 @@ export class StagehandAgentHandler {
67
67
) ;
68
68
}
69
69
70
+ if ( ! this . llmClient . getLanguageModel ) {
71
+ throw new Error (
72
+ "StagehandAgentHandler requires an AISDK-backed LLM client. Ensure your model is configured like 'openai/gpt-4.1-mini' in the provider/model format." ,
73
+ ) ;
74
+ }
70
75
const baseModel : LanguageModel = this . llmClient . getLanguageModel ( ) ;
71
76
const wrappedModel = wrapLanguageModel ( {
72
77
model : baseModel ,
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ export class AISdkClient extends LLMClient {
42
42
this . enableCaching = enableCaching ;
43
43
}
44
44
45
+ public getLanguageModel ( ) : LanguageModel {
46
+ return this . model ;
47
+ }
48
+
45
49
async createChatCompletion < T = ChatCompletion > ( {
46
50
options,
47
51
} : CreateChatCompletionOptions ) : Promise < T > {
You can’t perform that action at this time.
0 commit comments