작업 첨부 파일

포괄적인 분석을 위해 작업에 여러 유형의 파일을 첨부합니다.

빠른 시작#

전체 예제 클론하기#

가장 쉬운 시작 방법은 전체 예제 저장소를 클론하는 것입니다:

bash
git clone https://github.com/astreus-ai/examples
cd examples/task-attachments
npm install

또는 패키지만 설치하기#

처음부터 직접 구축하려면:

bash
npm install @astreus-ai/astreus

환경 설정#

bash
# .env
OPENAI_API_KEY=sk-your-openai-api-key-here
DB_URL=sqlite://./astreus.db

여러 첨부 파일이 있는 작업#

typescript
import { Agent } from '@astreus-ai/astreus';

const agent = await Agent.create({
  name: 'AnalysisAgent',
  model: 'gpt-6-astra',
  visionModel: 'gpt-6-astra',  // Specify vision model directly
  vision: true // Enable vision for images
});

// 여러 파일 유형을 포함한 코드 리뷰 작업
const reviewTask = await agent.createTask({
  prompt: `Perform a comprehensive analysis:
    1. Review the code for security issues
    2. Check the design mockup for usability
    3. Verify dependencies are up to date
    4. Review documentation completeness`,
  attachments: [
    { 
      type: 'code', 
      path: './src/auth/login.ts', 
      name: 'Login Controller',
      language: 'typescript' 
    },
    { 
      type: 'image', 
      path: './designs/login-ui.png', 
      name: 'Login UI Mockup' 
    },
    { 
      type: 'json', 
      path: './package.json', 
      name: 'Dependencies' 
    },
    { 
      type: 'markdown', 
      path: './docs/api.md', 
      name: 'API Documentation' 
    }
  ],
  metadata: {
    type: 'comprehensive-review',
    priority: 'high'
  }
});

const result = await agent.executeTask(reviewTask.id);
console.log('Analysis complete:', result.response);

예제 실행하기#

저장소를 클론했다면:

bash
npm run dev

처음부터 구축했다면, 위 코드로 index.ts 파일을 만들고 다음을 실행하세요:

bash
npx tsx index.ts

저장소#

전체 예제는 GitHub에서 확인할 수 있습니다: examples/task-attachments