Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/agents/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export default class Agent {
name: string;
/** Model name */
model: string;
/** Skills of the agent */
skills: Array<string>;
/** Additional parameters */
params: any;
/** Rest API client to use for executing agent operations */
Expand All @@ -27,22 +25,19 @@ export default class Agent {
* @param {string} project - Project name to which agent belongs to
* @param {string} name - Agent name
* @param {string} model - Model name
* @param {Array<string>} skills - Skills of the agent
* @param {any} params - Additional parameters
* @param {AgentsRestApiClient} agentsRestApiClient - Rest API client to use for executing agent operations
*/
constructor(
project: string,
name: string,
model: string,
skills: Array<string>,
params: any,
agentsRestApiClient: AgentsRestApiClient
) {
this.project = project;
this.name = name;
this.model = model;
this.skills = skills;
this.params = params;
this.agentsRestApiClient = agentsRestApiClient;
}
Expand All @@ -64,7 +59,6 @@ export default class Agent {
project,
json.name,
json.model,
json.skills.map((skill: any) => skill.name),
json.params || {},
agentsRestApiClient
);
Expand Down
4 changes: 0 additions & 4 deletions src/agents/agentsApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default abstract class AgentsApiClient {
* @param {string} name - The name of the agent.
* @param {string} model - The model of the agent.
* @param {string} provider - The provider of the agent.
* @param {Array<string>} skills - An array of skills for the agent.
* @param {any} [params] - Optional parameters for the agent.
* @throws {MindsDbError} If the agent cannot be created.
* @returns {Promise<Agent>} A promise that resolves to the created agent.
Expand All @@ -37,7 +36,6 @@ export default abstract class AgentsApiClient {
name: string,
model: string,
provider: string,
skills: Array<string>,
params?: any
): Promise<Agent>;

Expand All @@ -47,7 +45,6 @@ export default abstract class AgentsApiClient {
* @param {string} agentName - The current name of the agent.
* @param {string} [updatedName] - The new name of the agent (optional).
* @param {string} [updatedModel] - The new model of the agent (optional).
* @param {Array<string>} [updatedSkills] - An array of updated skills for the agent (optional).
* @param {any} [updatedParams] - Optional updated parameters for the agent.
* @throws {MindsDbError} If the agent cannot be updated.
* @returns {Promise<Agent>} A promise that resolves to the updated agent.
Expand All @@ -57,7 +54,6 @@ export default abstract class AgentsApiClient {
agentName: string,
updatedName?: string,
updatedModel?: string,
updatedSkills?: Array<string>,
updatedParams?: any
): Promise<Agent>;

Expand Down
27 changes: 0 additions & 27 deletions src/agents/agentsRestApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export default class AgentsRestApiClient extends AgentsApiClient {
* @param {string} name Agent name to create
* @param {string} [model] Model to use for the agent
* @param {string} [provider] Provider to use for the agent
* @param {Array<string>} [skills] Skills to assign to the agent
* @param {any} [params] Additional parameters for the agent
* @returns {Promise<Agent>} A promise that resolves to the created agent.
*/
Expand All @@ -84,7 +83,6 @@ export default class AgentsRestApiClient extends AgentsApiClient {
name: string,
model?: string,
provider?: string,
skills?: Array<string>,
params?: any
): Promise<Agent> {
const agentsUrl = this.getAgentsUrl(project);
Expand All @@ -98,13 +96,11 @@ export default class AgentsRestApiClient extends AgentsApiClient {
const agent: {
name: string;
model_name?: string;
skills?: Array<string>;
params?: any;
provider?: string | null;
} = {
name: name,
model_name: model || DEFAULT_LLM_MODEL,
skills: skills || [],
provider: provider || null,
params: agentsParams,
};
Expand All @@ -124,7 +120,6 @@ export default class AgentsRestApiClient extends AgentsApiClient {
* @param {string} agentName Name of the agent to update
* @param {string} [updatedName] New name for the agent
* @param {string} [updatedModel] New model for the agent
* @param {Array<string>} [updatedSkills] New skills for the agent
* @param {any} [updatedParams] New parameters for the agent
* @returns {Promise<Agent>} A promise that resolves to the updated agent.
*/
Expand All @@ -133,41 +128,19 @@ export default class AgentsRestApiClient extends AgentsApiClient {
agentName: string,
updatedName?: string,
updatedModel?: string,
updatedSkills?: Array<string>,
updatedParams?: any
): Promise<Agent> {
const agentsUrl = this.getAgentsUrl(project) + `/${agentName}`;
try {
const agent = await this.getAgent(project, agentName);
const updatedSkillSet = new Set<string>();
if (updatedSkills) {
updatedSkills?.forEach((skill) => updatedSkillSet.add(skill));
}
const existingSkillSet = new Set<string>(agent.skills);
const skillsToAddSet = new Set<string>(updatedSkillSet);
existingSkillSet.forEach((skill) => {
if (skillsToAddSet.has(skill)) {
skillsToAddSet.delete(skill);
}
});
const skillsToRemoveSet = new Set<string>(existingSkillSet);
updatedSkillSet.forEach((skill) => {
if (skillsToRemoveSet.has(skill)) {
skillsToRemoveSet.delete(skill);
}
});

const updatedAgent: {
name: string;
model_name: string;
skills_to_add: Array<string>;
skills_to_remove: Array<string>;
params: any;
} = {
name: updatedName || agent.name,
model_name: updatedModel || agent.model,
skills_to_add: Array.from(skillsToAddSet),
skills_to_remove: Array.from(skillsToRemoveSet),
params: updatedParams || agent.params,
};

Expand Down
3 changes: 0 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
import TablesModule from './tables/tablesModule';
import knowledgeBaseModule from './knowledge_bases/knowledge_baseModule';
import AgentsModule from './agents/agentsModule';
import skillsModule from './skills/skillsModule';
import HttpAuthenticator from './httpAuthenticator';
import { Axios } from 'axios';

Expand Down Expand Up @@ -67,7 +66,6 @@ const KnowledgeBases = new knowledgeBaseModule.KnowledgeBaseRestApiClient(
defaultAxiosInstance
);
const Agents = new AgentsModule.AgentsRestApiClient(defaultAxiosInstance);
const Skills = new skillsModule.SkillsRestApiClient(defaultAxiosInstance);

const Callbacks = new CallbacksModule.CallbacksRestApiClient(
defaultAxiosInstance,
Expand Down Expand Up @@ -135,7 +133,6 @@ export default {
Agents,
Callbacks,
KnowledgeBases,
Skills,
};
export {
ConnectionOptions,
Expand Down
156 changes: 0 additions & 156 deletions src/skills/skill.ts

This file was deleted.

58 changes: 0 additions & 58 deletions src/skills/skillsApiClient.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/skills/skillsModule.ts

This file was deleted.

Loading