AI 액션
GitLab에서 AI 액션을 구현하고 AI Gateway로 마이그레이션하는 방법을 설명합니다.
이 페이지에서는 액션을 구현하고 AI Gateway로 마이그레이션하는 방법을 설명합니다. 새로운 액션 구현 방법 # 새로운 AI 액션을 구현하려면 여러 컴포넌트에 걸쳐 변경이 필요합니다. 사용자가 주어진 프롬프트에 따라 이슈 설명을 다시 작성할 수 있도록 하는 액션을 구현하는 예시를 살펴보겠습니다. 1. Cloud Connector 기능 목록에 액션 추가 # Cloud Connector 구성에는 서비스에 접근하는 데 필요한 권한과 추가 메타데이터가 저장됩니다. 기능에 대한 항목이 없다면 Cloud Connector 단위 프리미티브로 기능을 추가하세요 : 자세한 내용은 Cloud Connector: 구성 을 참조하세요. 2. AI Gateway에서 프롬프트 정의 생성 # AI Gateway 프로젝트 에서 ai_gateway/prompts/definitions 하위에 [ai-action]/base/[prompt-version].yml 경로로 새 프롬프트 정의를 생성합니다 ( 프롬프트 버전 관리 규칙 참조). 사용할 모델과 제공업체를 지정하고, 모델에 제공할 프롬프트를 작성합니다. {} 를 사용하여 프롬프트에 입력값을 지정할 수 있습니다. # ai_gateway/prompts/definitions/rewrite_description/base/1.0.0.yml name: Description rewriter model: config_file: conversation_performant params: model_class_provider: anthropic prompt_template: system: | You are a helpful assistant that rewrites the description of resources. You'll be given the current description, and a prompt on how you should rewrite it. Reply only with your rewritten description. <description>{description}</description> <prompt>{prompt}</prompt> AI 액션이 여러 프롬프트를 사용하는 경우, [ai-action]/[prompt-name]/base/[version].yaml 형식의 트리 구조로 정의를 구성할 수 있습니다: # ai_gateway/prompts/definitions/code_suggestions/generations/base/1.0.0.yml name: Code generations model: config_file: conversation_performant params: model_class_provider: anthropic ... 여러 모델에 대한 프롬프트를 지정하려면 정의 경로에 모델 이름을 사용합니다: # ai_gateway/prompts/definitions/code_suggestions/generations/mistral/1.0.0.yml name: Code