Skip to content

Commit

Permalink
exports for vscode extension
Browse files Browse the repository at this point in the history
  • Loading branch information
nalbion committed Feb 17, 2024
1 parent 8664f31 commit 434ed08
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 15 deletions.
18 changes: 14 additions & 4 deletions src/agents/Agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ export default abstract class Agent {
AgentRegistry.registerAgent(agentConfig, this);
}

toString() {
return this.name;
}

addDisposeListener(callback: () => void) {
this.disposeListeners.push(callback);
}
Expand Down Expand Up @@ -105,10 +109,6 @@ export default abstract class Agent {
return this.agentConfig.routing?.roles || [];
}

toString() {
return this.name;
}

/**
* Adds the agent from agentConfig.routing.fallback to the fallbacks list
* @param getAgent function provided by AgentRegistry to get an Agent instance by name
Expand Down Expand Up @@ -196,6 +196,16 @@ export default abstract class Agent {
return this.workflowManager?.processUserRequest(input, context, this);
}

protected areStepRequirementsSatisified(_stepId: string, _context: AgentContext): boolean {
// TODO: workflowManager?.areStepRequirementsSatisified(input, context);
return true;
}

protected async executeStep(_stepId: string, _input: AgentInputMessage, _context: AgentContext): Promise<AgentResponse | undefined> {
// TODO: return this.workflowManager?.executeStep(input, context);
return undefined;
}

/**
* The prompt may be based on the input, the context and the Agent's state.
*
Expand Down
12 changes: 10 additions & 2 deletions src/agents/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
export { default as Agent } from './Agent';
export { AgentResponseMessage } from './types/AgentMessage';
export {
default as Agent,
llmResponseMessageToAgentResponse,
INSTALLATION_COMMAND,
InstallationInstructions,
} from './Agent';
export { type AgentInputMessage, type AgentResponseMessage, agentMessageToLlmMessages } from './types/AgentMessage';
export { type RoutingContext } from './AgentContext';
export { type AgentResponse } from './types/AgentResponse';
export { default as AgentRegistry } from './utils/AgentRegistry';
export { createAgent } from './utils/createAgent';
3 changes: 2 additions & 1 deletion src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { readAgentConfig } from './readAgentConfig';
export { getAgentsYmlPath } from './agents_yml';
export { default as readOaiConfigList, getOaiConfigListPath } from './OAI_CONFIG_LIST';
export { default as readOaiConfigList, getOaiConfigListPath, OAI_CONFIG_LIST } from './OAI_CONFIG_LIST';
export { default as SchemaValidationError, ParseError } from './SchemaValidationError';
37 changes: 33 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
export { readAgentConfig, getAgentsYmlPath, readOaiConfigList, getOaiConfigListPath } from './config';
export { createAgent, Agent } from './agents';
export { sendChatRequest } from './llm';
export { logger } from './utils';
export {
Agent,
type AgentInputMessage,
type AgentResponse,
type RoutingContext,
type InstallationInstructions,
INSTALLATION_COMMAND,
} from './agents';
export { createAgent, agentMessageToLlmMessages, llmResponseMessageToAgentResponse, AgentRegistry } from './agents';
export { AgentContext, ProgressData } from './agents/AgentContext';
export {
SchemaValidationError,
readAgentConfig,
getAgentsYmlPath
readOaiConfigList,
getOaiConfigListPath,
ParseError,
OAI_CONFIG_LIST,
} from './config';
export { sendChatRequest, LlmMessage, LlmResponseMessage, ChatCompletionRole } from './llm';
export { ModelManager } from './models';
export { ToolContext, ToolDefinition, ToolManager } from './tools';
export {
AgentConfig,
AgentsYml,
ChatRequestArgs,
ChatRequestOptions,
SlashCommand,
createChatRequestOptions,
ChatRequestOptionsWithOptionalModelConfig,
ModelSettings,
} from './types';
export { logger, Logger, parseYmlWithSchema, } from './utils';
2 changes: 1 addition & 1 deletion src/llm/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { sendChatRequest } from './sendChatRequest';
export { LlmMessage, LlmRequestMessage, LlmResponseMessage } from './message';
export { LlmMessage, LlmRequestMessage, LlmResponseMessage, ChatCompletionRole } from './message';
export { ChatCompletionTool } from './tools';
1 change: 1 addition & 0 deletions src/llm/openai/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { openAiChatRequest } from './openAiChatRequest';
2 changes: 1 addition & 1 deletion src/tools/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { ToolManager } from './ToolManager';
export { Tool } from './Tool';
export { ToolDefinition, ToolCallback } from './ToolTypes';
export { ToolContext, ToolDefinition, ToolCallback } from './ToolTypes';
9 changes: 8 additions & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
export { AgentsYml, AgentConfig, ModelConfig } from './AgentsYml';
export { AgentsYml, AgentConfig, ModelConfig, SlashCommand } from './AgentsYml';
export {
ChatRequestOptions,
ChatRequestOptionsWithOptionalModelConfig,
ChatRequestArgs,
createChatRequestOptions,
} from './ChatRequest';
export { ModelSettings } from './AIConfig';
3 changes: 2 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { logger } from './Logger';
export { logger, Logger } from './Logger';
export { normalisePath } from './fileUtils';
export { parseYmlWithSchema } from './parseYmlWithSchema';

0 comments on commit 434ed08

Please sign in to comment.