> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-feature-automate-reference-docs-generation.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

<Info>
  새로운 W\&B Inference 서비스를 무료로 사용해 보세요. API와 Weave Playground를 통해 AI 모델에 액세스할 수 있습니다.

  * [개발자 문서](./guides/integrations/inference)
  * [제품 페이지](https://wandb.ai/site/inference)
</Info>

첫 번째 호출을 추적하려면 다음 단계를 따르세요. 또한 <a className="inline-flex items-center" target="_blank" href="http://wandb.me/weave_colab"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab" /></a>

## 1. Weave 설치 및 API 키 받기

**weave 설치**

먼저, weave 라이브러리를 설치하세요:

<CodeGroup>
  ```bash Python
  pip install weave
  ```

  ```bash TypeScript
  pnpm install weave
  ```
</CodeGroup>

**API 키 받기**

W\&B 계정을 [https://wandb.ai](https://wandb.ai)에서 만드세요. 그런 다음 [https://wandb.ai/authorize](https://wandb.ai/authorize)에서 API 키를 복사하세요.

## 2. 새 프로젝트에 추적 기록하기

첫 번째 프로젝트를 추적하려면 다음 단계를 따르세요:

* 라이브러리 `weave` 가져오기
* 추적을 시작하려면 `weave.init('project-name')` 호출하기
  * 아직 로그인하지 않은 경우 시스템이 API 키를 요청합니다
  * 팀에 로깅하려면 `team-name/project-name`
  * 로그인 프롬프트를 건너뛰려면 `WANDB_API_KEY` 환경 변수를 설정하세요
* 추적하려는 함수에 `@weave.op()`를 추가하세요

*이 예제는 OpenAI를 사용합니다. OpenAI [API key](https://platform.openai.com/docs/quickstart/step-2-setup-your-api-key)가 필요합니다.*

<CodeGroup>
  ```python Python
  import weave
  from openai import OpenAI

  client = OpenAI()

  # Weave tracks the inputs, outputs and code of this function
  @weave.op()
  def extract_dinos(sentence):
      response = client.chat.completions.create(
          model="gpt-4o",
          messages=[
              {
                  "role": "system",
                  "content": """Extract dinosaurs from the text. Return JSON with:
  - dinosaurs: list of dinosaurs
  - name: scientific name  
  - common_name: nickname
  - diet: herbivore or carnivore."""
              },
              {
                  "role": "user",
                  "content": sentence
              }
          ],
          response_format={ "type": "json_object" }
      )
      return response.choices[0].message.content


  # Start the weave project
  weave.init('jurassic-park')

  sentence = """I saw a T. rex chase a Triceratops. 
  The T. rex eats meat. The Triceratops eats plants.
  A Brachiosaurus ate leaves from tall trees nearby."""

  result = extract_dinos(sentence)
  print(result)
  ```

  ```typescript TypeScript
  import OpenAI from 'openai';
  import * as weave from 'weave';

  const openai = new OpenAI();

  async function extractDinos(input) {
    const response = await openai.chat.completions.create({
      model: 'gpt-4o',
      messages: [
        {
          role: 'user',
          content: `Extract dinosaurs from this text. Return JSON with name, common_name, and diet: ${input}`,
        },
      ],
    });
    return response.choices[0].message.content;
  }

  const extractDinosOp = weave.op(extractDinos);

  async function main() {
    await weave.init('examples');
    const result = await extractDinosOp(
      'I saw a T. rex chase a Triceratops. The T. rex eats meat. The Triceratops eats plants. A Brachiosaurus ate leaves from tall trees nearby.'
    );
    console.log(result);
  }

  main();
  ```
</CodeGroup>

호출하면 `extract_dinos`, Weave는 추적을 볼 수 있는 링크를 보여줍니다.

## 3. 자동 AI 라이브러리 로깅

Weave는 많은 AI 서비스에 대한 호출을 추적합니다:

* OpenAI
* Anthropic
* [그 외 많은 AI 라이브러리](./guides/integrations/index)

Weave 로깅:

* AI 모델 정보
* 토큰 사용량
* 비용

다른 AI 도구를 추적하려면 `@weave.op()`로 래핑하세요.

## 4. 프로젝트에서 추적 보기

잘 하셨습니다. 이제 Weave는 함수를 호출할 때마다 데이터를 캡처합니다. 또한 코드 변경 사항도 추적합니다.

![Weave Trace Outputs 1](https://mintlify.s3.us-west-1.amazonaws.com/wb-21fd5541-feature-automate-reference-docs-generation/ko/images/tutorial_trace_1.png)

## 다음 단계

* 앱에서 [track data flow](./tutorial-tracing_2)하는 방법 배우기
* Weave 작동 방식을 알아보려면 [Tracing](./guides/tracking/tracing)에 대해 읽어보세요
* 모든 AI 제공업체에 대한 [Integrations](./guides/integrations/index)를 확인하세요
* 다양한 모델을 테스트하려면 [Playground](./guides/tools/playground)를 사용해 보세요
