Skip to content

feat: Automate Agentica connector setup and validation & connector select test #983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

lyutvs
Copy link
Contributor

@lyutvs lyutvs commented Apr 8, 2025

This pull request includes a series of updates across multiple files, focusing on dependency upgrades, refactoring, and the removal of unused modules. The most important changes are grouped by theme and listed below:

Dependency Upgrades:

  • Updated various dependencies in package.json to their latest versions. This includes significant upgrades to packages such as @commitlint/cli, @nestia/sdk, typescript, and many others.

Refactoring:

  • Refactored the GoogleSlidesService, MarpService, and StableDiffusionBetaService classes to remove direct dependency on the FileManager class, instead passing it through the props parameter. [1] [2] [3]
  • Adjusted the IGoogleSlidesService, IMarpService, and IStableDiffusionBetaService structures to include fileManager in their IProps types. [1] [2] [3]

Version Bump:

  • Incremented the version number in connectors-list.json from 0.1.486 to 0.1.488.

Removal of Unused Modules:

  • Removed the KeywordExtractController, KeywordExtractModule, LlmController, and LlmModule files, indicating that these modules are no longer in use. [1] [2] [3] [4]

Minor Fixes:

  • Fixed formatting in pnpm-workspace.yaml by changing single quotes to double quotes for package exclusions.
  • Cleaned up comments in YoutubeOfficialSearchService for better readability. [1] [2]

These changes collectively improve the codebase by updating dependencies, refactoring for better maintainability, and removing unused code.feat: Add script to automate Agentica connector setup and validation

This PR introduces a script to automate the process of setting up and performing initial validation for Agentica projects based on connectors found in ../../packages.

Key Features:

  • Discovers connectors in the packages directory (respecting an ignore list).
  • Runs npx agentica start interactively for each connector.
  • Analyzes connector source code to identify required environment variables (ENV_LIST) and whether a FileManager (specifically AwsS3Service) is needed.
  • Generates/updates a .env file in the created project (test-<connector-name>) with required variables (appending new ones, using placeholders).
  • Modifies the generated src/index.ts to inject environment variables and AwsS3Service instance into the service constructor as needed.
  • Installs @wrtnlabs/connector-aws-s3 if FileManager is required.
  • Runs npm install, npm run build, and npm run start for basic validation.

Benefits:

  • Significantly speeds up the setup process for testing connectors.
  • Ensures consistent project scaffolding and initial setup.
  • Provides basic validation for each connector's generated template.

(Korean Summary / 한국어 요약)
../../packages 내 커넥터들을 기반으로 Agentica 프로젝트 생성을 자동화하고 기본 검증을 수행하는 스크립트를 추가합니다. 각 커넥터에 대해 agentica start 실행, 필요 환경변수(ENV_LIST) 및 FileManager 사용 여부 분석, .env 파일 생성/업데이트 (신규 변수 추가), src/index.ts 수정 (환경변수 및 AwsS3Service 주입), npm install/build/start 실행을 자동화하여 테스트 준비 과정을 단축하고 일관성을 확보합니다.

@lyutvs lyutvs self-assigned this Apr 8, 2025
@lyutvs lyutvs requested a review from Copilot April 8, 2025 07:28
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

@lyutvs lyutvs changed the title feat: connector test start with agentica cli feat: Automate Agentica connector setup and validation Apr 8, 2025
Copy link
Collaborator

@kakasoo kakasoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

너무 길어요...

@lyutvs lyutvs changed the title feat: Automate Agentica connector setup and validation feat: Automate Agentica connector setup and validation & connector select test Apr 11, 2025
Copy link
Contributor

@8471919 8471919 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait to update the agentica cli please.

@@ -1,4 +1,10 @@
import { FileManager } from "@wrtnlabs/connector-shared/lib";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove lib

): string[] {
try {
if (!fs.existsSync(packagesPath)) {
console.warn(`⚠️ 경로를 찾을 수 없습니다: ${packagesPath}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if you could change these parts to English :)

Comment on lines +84 to +91
await sendKey(" ", "스페이스 선택", 500);
await sendKey("\r", "엔터", 500);
} else {
console.warn(`⚠️ 유효하지 않은 connectorIndex: ${connectorIndex}`);
}

await sendKey("\x1B[D", "Yes ←");
await sendKey("\r", "Yes 선택");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, I'm now updating the agentica cli, so will be added environment variable input step between selecting connector step and entering openai apikey step.

Comment on lines +192 to +211
// 3.1 ENV_LIST 찾기 (아직 못 찾은 경우)
if (!foundEnvList) {
const envListMatch = content.match(
/export\s+const\s+ENV_LIST\s*=\s*\[([\s\S]*?)\]/,
);
if (envListMatch) {
const envListStr = envListMatch[1];
const envVarMatches = envListStr.match(/'([^']+)'|"([^"]+)"/g);
if (envVarMatches) {
envList = envVarMatches.map((match) =>
match.replace(/['"]/g, ""),
);
console.log(
`[${connectorName}] Found ENV_LIST in ${filePath}:`,
envList,
);
foundEnvList = true; // 찾았음을 표시
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo. in my opinion) In this part, I think you can use the dynamic import to get the const ENV_LIST.

Comment on lines +324 to +336
if (hasFileManager) {
const awsEnvVars = [
"AWS_ACCESS_KEY_ID",
"AWS_SECRET_ACCESS_KEY",
"AWS_S3_BUCKET",
"AWS_S3_REGION",
];
awsPropsStr = "{\n"; // 여기서 awsPropsStr 초기화
awsEnvVars.forEach((envVar) => {
const camelCaseKey = toCamelCase(envVar);
awsPropsStr += ` ${camelCaseKey}: process.env.${envVar}!,\n`;
});
awsPropsStr += " }"; // 들여쓰기 조정
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, new FileManager can be created like Azure, GCP, LocalFileSystem, and so on.
so this part will be changed someday.

@lyutvs lyutvs marked this pull request as draft April 21, 2025 02:33
@lyutvs
Copy link
Contributor Author

lyutvs commented Apr 21, 2025

I'll change agentica cli test

why

  • cli steps chagned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants