Skip to content

Commit 8309772

Browse files
authored
Merge pull request #53 from CopilotKit/fix/rename-basicagent
fix: rename BasicAgent to BuiltInAgent and add deprecation
2 parents 3dc6dec + 572e43b commit 8309772

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

packages/agent/src/index.ts

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ export type OverridableProperty =
6262
| "prompt";
6363

6464
/**
65-
* Supported model identifiers for BasicAgent
65+
* Supported model identifiers for BuiltInAgent
6666
*/
67-
export type BasicAgentModel =
67+
export type BuiltInAgentModel =
6868
// OpenAI models
6969
| "openai/gpt-5"
7070
| "openai/gpt-5-mini"
@@ -205,7 +205,7 @@ export function resolveModel(spec: ModelSpecifier): LanguageModel {
205205
}
206206

207207
/**
208-
* Tool definition for BasicAgent
208+
* Tool definition for BuiltInAgent
209209
*/
210210
export interface ToolDefinition<TParameters extends z.ZodTypeAny = z.ZodTypeAny> {
211211
name: string;
@@ -215,7 +215,7 @@ export interface ToolDefinition<TParameters extends z.ZodTypeAny = z.ZodTypeAny>
215215
}
216216

217217
/**
218-
* Define a tool for use with BasicAgent
218+
* Define a tool for use with BuiltInAgent
219219
* @param name - The name of the tool
220220
* @param description - Description of what the tool does
221221
* @param parameters - Zod schema for the tool's input parameters
@@ -423,13 +423,13 @@ export function convertToolDefinitionsToVercelAITools(tools: ToolDefinition[]):
423423
}
424424

425425
/**
426-
* Configuration for BasicAgent
426+
* Configuration for BuiltInAgent
427427
*/
428-
export interface BasicAgentConfiguration {
428+
export interface BuiltInAgentConfiguration {
429429
/**
430430
* The model to use
431431
*/
432-
model: BasicAgentModel | LanguageModel;
432+
model: BuiltInAgentModel | LanguageModel;
433433
/**
434434
* Maximum number of steps/iterations for tool calling (default: 1)
435435
*/
@@ -492,10 +492,10 @@ export interface BasicAgentConfiguration {
492492
tools?: ToolDefinition[];
493493
}
494494

495-
export class BasicAgent extends AbstractAgent {
495+
export class BuiltInAgent extends AbstractAgent {
496496
private abortController?: AbortController;
497497

498-
constructor(private config: BasicAgentConfiguration) {
498+
constructor(private config: BuiltInAgentConfiguration) {
499499
super();
500500
}
501501

@@ -976,10 +976,20 @@ export class BasicAgent extends AbstractAgent {
976976
}
977977

978978
clone() {
979-
return new BasicAgent(this.config);
979+
return new BuiltInAgent(this.config);
980980
}
981981

982982
abortRun(): void {
983983
this.abortController?.abort();
984984
}
985985
}
986+
987+
/**
988+
* @deprecated Use BuiltInAgent instead
989+
*/
990+
export class BasicAgent extends BuiltInAgent {
991+
constructor(config: BuiltInAgentConfiguration) {
992+
super(config);
993+
console.warn("BasicAgent is deprecated, use BuiltInAgent instead");
994+
}
995+
}

0 commit comments

Comments
 (0)