OpenAI API를 사용하는 GPT-5 Python 빠른 시작 가이드
OpenAI API를 사용해 Python에서 GPT-5를 설정하고 로컬 머신에서 실행하기. 이 글은 AI 번역본입니다. 오역이 의심되면 댓글로 알려 주세요.
Created on September 15|Last edited on September 15
Comment
GPT-5가 공개되자마자 우리는 새로운 API 기능들을 바로 실험해 보기로 했습니다. GPT-5는 추론 노력 제어, 네이티브 구조화 출력, 내장 이미지 생성, 그리고 매끄러운 멀티모달 워크플로를 도입해 AI 애플리케이션을 만드는 방식을 크게 바꿔 놓을 수 있습니다.
이 튜토리얼에서는 15분도 안 되어 GPT-5의 가장 강력한 기능들을 익힐 수 있습니다. 새로운 Responses API를 살펴보고, Pydantic으로 검증 가능한 JSON 출력을 보장하며, 텍스트를 완벽하게 보완하는 이미지를 생성하고, 서로 다른 추론 노력 수준을 비교합니다. 이 모든 과정은 다음과 함께 전부 로깅됩니다. W&B Weave 완전한 가시성을 위해 AI 워크플로GitHub에서도 확인할 수 있습니다. 여기.
마지막에는 프로덕션 준비가 된 애플리케이션을 구축하거나 업그레이드하는 데 도움이 될 만한 새로운 아이디어를 얻게 될 것입니다. 먼저 GPT-5의 개선 사항 일부를 간단히 살펴보겠지만, 바로 코드로 들어가고 싶다면 아래 버튼을 클릭하세요.
Jump to the tutorial
목차
GPT-5 API 시작하기OpenAI API 키 생성하기GPT-5용 OpenAI 요금 안내W&B Weave 튜토리얼: GPT-5 시작하기1단계: OpenAI GPT-5 API 키2단계: OpenAI와 W&B Weave 설치3단계: 라이브러리를 임포트하고 OpenAI API 키를 전달하세요4단계: 첫 GPT-5 호출 만들기5단계: GPT-5 Responses API로 텍스트 생성W&B Weave에서 GPT-5 입력과 출력 보기7단계: GPT-5 추론 제어 - 낮음, 보통, 높음 수준 테스트8단계: 커스텀 어시스턴트로 구조화된 JSON 출력[[TRANSLATION_FAILED]]10단계: 종합 튜토리얼 요약11단계: Weave에서 작업 검토하기결론관련 읽을거리
💡
설정이 끝났다면 OpenAI API가 필요합니다. 여기부터 시작해 봅시다:
GPT-5 API 시작하기
API를 통해 GPT-5를 사용하기 전에, 먼저 유효한 API 키가 필요합니다. 다음으로 이동하세요 OpenAI 제품 페이지 그리고 회원가입을 시작하려면 "Start building"을 클릭하세요.

가입을 마치면 이메일과 전화번호를 확인하여 대시보드를 활성화하세요. 거기에서 프로젝트와 키를 관리할 수 있습니다.
OpenAI API 키 생성하기
대시보드에서 왼쪽 상단의 현재 프로젝트 이름(예: Default project)을 클릭하세요.

프로젝트를 만들었으면 설정으로 이동하세요:

그리고 나서 API 키로 이동하세요:

프로젝트 안에서 API 키로 이동한 다음 “Create key”를 클릭하세요. 이름을 입력하라는 메시지가 표시됩니다.

고도의 보안이 보장된 장소가 아니라면 키를 저장하지 마세요(바탕화면의 메모장 문서는 보안에 적합하지 않습니다). 잠깐 사용했다면 저장하지 말고 메모장 문서를 바로 닫으세요.
💡
GPT-5용 OpenAI 요금 안내
가입하면 5달러의 크레딧이 제공되며, 가볍게 실험해 보는 데는 꽤 넉넉합니다! 이 문서를 작성하는 현재 기준(2025년 8월 7일) GPT-5의 가격은 다음과 같습니다:

W&B Weave
함께 W&B Weave, 데코레이터를 적용한 함수는 호출될 때마다 자동으로 캡처되어 입력, 출력, 실행 메타데이터, 환경 정보까지 추가 코드 없이 모두 기록됩니다. 다음만 추가하세요 @weave.op() 생성 함수에 decorator를 추가하기만 하면 나머지는 Weave가 처리합니다. 실행이 끝나면 Weave 대시보드에서 대화형 트레이스를 탐색하세요. 프롬프트와 모델 응답을 나란히 보고, 타이밍과 자원 사용량을 확인하며, 실행들을 나란히 비교하고, 주석을 달거나 팀과 결과를 공유할 수 있습니다. 이 모든 작업을 하나의 통합된 인터페이스에서 수행할 수 있습니다.
튜토리얼: GPT-5 시작하기
Jupyter Notebook, Colab, 또는 어떤 Python REPL에서도 따라 할 수 있습니다. 빠르게 Python 환경을 준비해야 한다면 다음을 확인하세요 이 튜토리얼그렇지 않다면, 이제 코드를 살펴보겠습니다.
Jupyter Notebook의 큰 장점 중 하나는 Colab과 마찬가지로 마크다운 필드에 댓글과 맥락을 추가할 수 있다는 점입니다:

1단계: OpenAI GPT-5 API 키
먼저 OpenAI API 키를 환경 변수로 내보내세요:
%env OPENAI_API_KEY=KEY
바꾸기 KEY 값을 자신의 것으로 설정하세요. Jupyter에서 이 코드를 실행하면 키가 다시 출력되어 활성화되었음을 확인할 수 있습니다.

2단계: OpenAI와 W&B Weave 설치
이 명령은 공식 OpenAI 클라이언트와 Weights & Biases Weave를 모두 설치합니다.
지금이 좋은 때입니다 Weights & Biases에 가입하기몇 분 뒤 더 진행했을 때 작업 흐름을 방해하지 않도록 미리 저장해 두세요.
!pip install openai weave
그리고 셀을 실행하세요.
셀 실행이 끝날 때까지 기다리세요— [*] 표시기가 숫자로 바뀝니다.
💡

이제 설치는 완료됐지만, 사용하려면 아직 임포트해야 합니다.
Python이 처음이라면기본적으로 라이브러리를 설치할 때는 그 코드를 가져오는 것이고, 임포트할 때는 그 라이브러리를 실제로 사용할 수 있도록 만드는 것입니다.
예전에 들은 비유가 아주 좋았어요. 설치는 서버에 이미지를 업로드하는 것과 같고, 임포트는 그 이미지가 준비되면 페이지에 삽입해서 보여주는 것과 같습니다.
💡
3단계: 라이브러리를 임포트하고 OpenAI API 키를 전달하세요
다음으로 패키지를 로드하고 Weave와 OpenAI 클라이언트를 모두 설정하세요:
import osimport weavefrom openai import OpenAI# Initialize Weaveweave.init('gpt-5-tutorial')# Initialize OpenAI clientclient = OpenAI(api_key=os.getenv('OPENAI_API_KEY'))
4단계: 첫 GPT-5 호출 만들기
프롬프트 설계는 여전히 핵심입니다. 먼저 어시스턴트의 역할과 사용자의 요청을 정의하세요:
gpt_assistant_prompt = "You are a " + input ("Who should I be, as I answer your prompt?")gpt_user_prompt = input ("What do you want me to do?")

5단계: GPT-5 Responses API로 텍스트 생성
GPT-5에는 여러 가지 강력한 기능이 새롭게 도입되었습니다:
- Responses API: 모델과 상호작용하는 더 유연한 방법
- 추론 제어: 복잡한 문제에 맞춰 계산 노력을 조정하기
- 강화된 역할 시스템: 개발자, 사용자, 어시스턴트 메시지 역할
- 구조화된 출력: 스키마에 맞는 유효한 JSON 생성하기
- 이미지 생성 내장형 이미지 생성 기능
새로운 Responses API는 이전 GPT보다 더 많은 제어권과 더 나은 구조화된 출력을 제공합니다.
또한, 아래 함수들은 @weave.op() 데코레이터를 사용하면 Weave가 모든 내용을 기록합니다.
@weave.op()def generate_with_custom_prompts(assistant_prompt: str, user_prompt: str, reasoning_effort: str = "low") -> dict:"""Generate text using your custom prompts with GPT-5's Responses API"""response = client.responses.create(model="gpt-5",reasoning={"effort": reasoning_effort},input=[{"role": "developer","content": assistant_prompt},{"role": "user","content": user_prompt}])return {"output_text": response.output_text,"assistant_role": assistant_prompt,"user_request": user_prompt,"reasoning_effort": reasoning_effort}# Use your custom promptsbasic_result = generate_with_custom_prompts(gpt_assistant_prompt, gpt_user_prompt, "medium")print("Generated response:", basic_result["output_text"])
실행하면 다음과 같이 표시됩니다:

요청에 몇 가지 추가 매개변수를 함께 전달한 것을 확인할 수 있습니다. 이는 로깅을 위해 Weave로 전달되며, 다른 프롬프트나 구성과 쉽게 비교할 수 있습니다.

W&B Weave에서 GPT-5 입력과 출력 보기
마지막 셀을 실행하면 노트북 출력에 각 Trace로 연결되는 링크가 표시됩니다. 링크를 클릭하면 Weave 대시보드가 열리며, 입력, 출력, 코드 버전, 실행 시간, 동료 코멘트를 모두 풍부한 시각 형태로 확인할 수 있습니다.

다음과 같은 내용이 표시될 것입니다:

오른쪽 상단의 탭을 클릭하면 다음과 같은 추가 세부 정보를 확인할 수 있습니다:
해당 Trace를 생성한 코드:

동료나 다른 사용자가 남긴 Trace에 대한 피드백
그리고 실행 중이던 환경의 요약은 다음과 같습니다:
7단계: GPT-5 추론 제어 - 낮음, 보통, 높음 수준 테스트
이제 GPT-5의 가장 강력한 기능 중 하나인 추론 노력 제어를 살펴보겠습니다. 이 기능을 사용하면 요청을 처리할 때 모델이 사고에 할당하는 계산 자원 규모를 조절할 수 있습니다. 누군가에게 “빠르게 답해달라”고 부탁하는 것과 “문제를 깊이 숙고해달라”고 요청하는 차이를 떠올리면 됩니다.
세 가지 노력 수준은 서로 다르게 동작합니다:
- 낮은 노력 수준: 빠르고 효율적이며, 단순한 작업에 적합합니다
- 보통 노력 수준: 대부분의 사용 사례에 잘 맞는 균형 잡힌 접근 방식
- 높은 노력 수준: 신중한 추론이 필요한 복잡한 문제에 대한 깊이 있는 사고
각 노력 수준에서 우리의 커스텀 어시스턴트가 어떻게 동작하는지 확인해 봅시다.
@weave.op()def generate_with_reasoning_levels(assistant_prompt: str, user_prompt: str) -> dict:"""Compare your prompts across different reasoning effort levels"""results = {}efforts = ["low", "medium", "high"]for effort in efforts:print(f"Generating with {effort} reasoning effort...")response = client.responses.create(model="gpt-5",reasoning={"effort": effort},input=[{"role": "developer","content": assistant_prompt},{"role": "user","content": user_prompt}])results[effort] = {"output": response.output_text,"effort_level": effort}return results# Compare reasoning levels with your promptsreasoning_comparison = generate_with_reasoning_levels(gpt_assistant_prompt, gpt_user_prompt)print("\n🧠 Your Prompts with Different Reasoning Levels:")for effort, result in reasoning_comparison.items():print(f"\n--- {effort.upper()} EFFORT ---")print(result["output"])print("-" * 50)
이제 세 가지 모든 추론 수준의 결과가 Weave로 전송되어, 손쉽게 비교할 수 있도록 기록으로 보관됩니다:

노력 수준이 높을수록 일반적으로 더 철저하고 미묘한 응답을 생성하지만, 더 오래 걸리고 비용도 더 듭니다. 이는 어시스턴트의 역할에 깊은 전문성이나 복잡한 문제 해결이 요구될 때 특히 유용합니다.
8단계: 커스텀 어시스턴트로 구조화된 JSON 출력
GPT-5의 혁신적인 기능 중 하나는 Structured Outputs입니다. 이는 모델의 응답이 특정 스키마를 준수하는 유효한 JSON임을 보장하는 능력입니다. 신뢰할 수 있고 파싱 가능한 데이터가 필요한 애플리케이션에 매우 강력합니다.
OpenAI Responses API는 구조화된 출력 생성을 지원합니다. text_format Pydantic 모델 또는 JSON 스키마와 함께 사용하는 매개변수입니다. 두 가지 접근 방식을 모두 살펴보겠습니다:
방법 1: Pydantic 모델 사용
스키마 준수를 보장하기 위해 Python 타입 정의와 함께 OpenAI의 기본 Structured Outputs를 사용합니다.
먼저, 파싱 문제를 피하기 위해 Pydantic 모델과 함수를 따로 정의하겠습니다:
# Import required librariesfrom pydantic import BaseModelfrom typing import List# Define the Pydantic modelclass AssistantResponse(BaseModel):response: strkey_points: List[str]confidence_level: strfollow_up_questions: List[str]# Define the function - simplified for Weave compatibilitydef generate_structured_with_pydantic_simple(assistant_prompt, user_prompt):"""Generate structured output using Pydantic models - Weave-compatible version"""response = client.responses.parse(model="gpt-5",input=[{"role": "developer", "content": assistant_prompt},{"role": "user", "content": user_prompt}],text_format=AssistantResponse)result = {"structured_data": response.output_parsed.model_dump(),"raw_output": response.output_text,"assistant_role": assistant_prompt,"validation_status": "valid"}return result# Alternative: Manual logging approach to avoid Weave parsing issuesdef log_and_call_pydantic(assistant_prompt, user_prompt):"""Manually log the call to avoid Weave parsing errors"""print(f"📝 Calling Pydantic structured output...")print(f" Assistant: {assistant_prompt[:50]}...")print(f" User: {user_prompt[:50]}...")result = generate_structured_with_pydantic_simple(assistant_prompt, user_prompt)print(f"✅ Success! Generated {len(result['structured_data'])} structured fields")return result# Test with Pydantic approachprint("Testing Pydantic structured output...")try:pydantic_result = log_and_call_pydantic(gpt_assistant_prompt, gpt_user_prompt)print("✅ Pydantic Structured Output:")print(pydantic_result["structured_data"])print(f"Validation Status: {pydantic_result['validation_status']}")except Exception as e:print(f"❌ Pydantic method failed: {e}")print("Falling back to JSON schema method...")
다음이 출력됩니다:

방법 2: JSON 스키마 사용
명확한 제어를 위해 명시적인 JSON 스키마 정의와 함께 OpenAI의 기본 구조화 출력 기능을 사용합니다.
def generate_structured_with_json_schema(assistant_prompt, user_prompt):"""Generate structured output using JSON schema"""schema = {"type": "object","properties": {"response": {"type": "string","description": "Main response from the assistant"},"key_points": {"type": "array","items": {"type": "string"},"description": "Key points or takeaways"},"confidence_level": {"type": "string","enum": ["low", "medium", "high"],"description": "Assistant's confidence in the response"},"follow_up_questions": {"type": "array","items": {"type": "string"},"description": "Suggested follow-up questions"}},"additionalProperties": False,"required": ["response", "key_points", "confidence_level", "follow_up_questions"]}response = client.responses.create(model="gpt-5",input=[{"role": "developer","content": assistant_prompt},{"role": "user","content": user_prompt}],text={"format": {"type": "json_schema","name": "assistant_response", # This was missing!"strict": True,"schema": schema}})import jsonparsed_data = json.loads(response.output_text)return {"structured_data": parsed_data,"raw_output": response.output_text,"assistant_role": assistant_prompt,"schema_used": schema,"validation_status": "valid"}# Test with JSON schema approachprint("Testing JSON schema structured output...")try:schema_result = generate_structured_with_json_schema(gpt_assistant_prompt, gpt_user_prompt)print("✅ JSON Schema Structured Output:")print(schema_result["structured_data"])print(f"Validation Status: {schema_result['validation_status']}")except Exception as e:print(f"❌ JSON Schema method failed: {e}")print("This may be due to API differences - the Pydantic method above is more reliable.")
다음이 생성됩니다:

또는 Weave에서는:

방법 3: 프롬프트 엔지니어링을 활용한 폴백
네이티브 구조화 출력이 없거나 정상 동작하지 않을 때는 신중한 프롬프트 작성과 검증을 사용합니다.
@weave.op()def generate_structured_fallback(assistant_prompt: str, user_prompt: str) -> dict:"""Fallback method using careful prompt engineering"""json_instructions = '''You must respond with valid JSON in exactly this format:{"response": "your main response here","key_points": ["point 1", "point 2", "point 3"],"confidence_level": "low|medium|high","follow_up_questions": ["question 1", "question 2"]}Output ONLY the JSON, no additional text.'''response = client.responses.create(model="gpt-5",reasoning={"effort": "medium"},input=[{"role": "developer","content": f"{assistant_prompt}\n\n{json_instructions}"},{"role": "user","content": user_prompt}])try:import jsonparsed_data = json.loads(response.output_text)return {"structured_data": parsed_data,"raw_output": response.output_text,"validation_status": "valid"}except json.JSONDecodeError as e:return {"structured_data": None,"raw_output": response.output_text,"validation_status": f"invalid JSON: {str(e)}","error": str(e)}# Try methods in order of preferenceprint("🔧 Testing Structured Output Methods:")# Try Pydantic first (most reliable)try:result = generate_structured_with_pydantic(gpt_assistant_prompt, gpt_user_prompt)print("✅ Success with Pydantic!")structured_result = resultexcept:print("⚠️ Pydantic failed, trying JSON schema...")# Try JSON schematry:result = generate_structured_with_json_schema(gpt_assistant_prompt, gpt_user_prompt)print("✅ Success with JSON schema!")structured_result = resultexcept:print("⚠️ JSON schema failed, using prompt engineering fallback...")# Fallback to prompt engineeringstructured_result = generate_structured_fallback(gpt_assistant_prompt, gpt_user_prompt)print("📝 Using prompt engineering approach")print(f"\nFinal structured result:")if structured_result.get("structured_data"):print(structured_result["structured_data"])print(f"Status: {structured_result['validation_status']}")else:print("Failed to generate valid structured output")print(f"Raw output: {structured_result['raw_output']}")
이를 통해 다음을 얻습니다:

그리고 Weave에서는:

왜 구조화된 출력을 사용할까요?
방법 1·2(네이티브 구조화 출력) vs 방법 3(프롬프트 엔지니어링):
네이티브 구조화 출력으로 다음을 얻을 수 있습니다:
- 보장된 결과: AI는 지정한 스키마를 정확히 따라야 합니다. 구문 분석 오류나 누락된 필드가 없어야 합니다.
- 검증은 필요 없습니다: JSON이 유효하고 완전한지 확인하는 번거로움을 건너뛰세요
- 명확한 오류 처리: 안전 관련 거부는 불완전한 응답에 숨지지 않고 명확하게 표시됩니다
간단한 API 사용법:
- 방법 1: client.responses.parse(text_format=YourPydanticModel)
- 방법 2: client.responses.create(text={"format": {"type": "json_schema", ...}})
[[TRANSLATION_FAILED]]
- [[TRANSLATION_FAILED]]
- [[TRANSLATION_FAILED]]
- [[TRANSLATION_FAILED]]
[[TRANSLATION_FAILED]][[TRANSLATION_FAILED]]
[[TRANSLATION_FAILED]]
[[TRANSLATION_FAILED]]
8단계에서 만든 구조화된 출력을 활용해, 어시스턴트가 그 내용을 시각적으로 표현하도록 하겠습니다.
import base64from PIL import Imageimport iodef generate_image_with_gpt5(prompt: str) -> dict:"""Generate an image using GPT-5's built-in image generation via tools"""try:response = client.responses.create(model="gpt-5",input=prompt,tools=[{"type": "image_generation"}],)# Extract the image data from the responseimage_data = [output.resultfor output in response.outputif output.type == "image_generation_call"]if image_data:image_base64 = image_data[0]# Convert base64 to PIL Image for Weave displayimage_bytes = base64.b64decode(image_base64)image = Image.open(io.BytesIO(image_bytes))return {"image": image, # PIL Image object for Weave"image_base64": image_base64,"prompt_used": prompt,"status": "success"}else:return {"error": "No image data found in response"}except Exception as e:return {"error": str(e)}@weave.op()def create_image_for_existing_content(assistant_prompt: str, existing_content: dict) -> dict:"""Generate an image based on previously created content"""# Extract the main response from our structured contentmain_response = existing_content.get("structured_data", {}).get("response", "")key_points = existing_content.get("structured_data", {}).get("key_points", [])if not main_response:return {"error": "No existing content found to create image for"}# Step 1: Have your assistant create an image prompt based on the existing contentimage_prompt_response = client.responses.create(model="gpt-5",reasoning={"effort": "low"},input=[{"role": "developer","content": f"{assistant_prompt} Now act as a visual artist and create a detailed image description that would perfectly complement the content you previously created. Focus on visual elements, style, mood, and composition. Keep it under 300 characters for optimal image generation."},{"role": "user","content": f"Create an image description for this content you generated:\n\nMain response: {main_response}\n\nKey points: {', '.join(key_points)}\n\nDescribe an image that would enhance and complement this content."}])image_prompt = image_prompt_response.output_textprint(f"🎨 Your assistant's image prompt: {image_prompt}")# Step 2: Generate the image using GPT-5's tool-based image generationimage_result = generate_image_with_gpt5(f"Generate an image: {image_prompt}")return {"original_content": existing_content,"image_prompt": image_prompt,"image_result": image_result,"assistant_role": assistant_prompt,"generated_image": image_result.get("image") if "error" not in image_result else None # PIL Image for Weave}# Use the structured content from Step 8 to create an accompanying imageprint("🖼️ Creating an image for your previously generated content...")# Check if we have structured content from previous stepsif 'pydantic_result' in locals() and pydantic_result.get("structured_data"):print(f"Using content: '{pydantic_result['structured_data']['response'][:50]}...'")multimodal_result = create_image_for_existing_content(gpt_assistant_prompt, pydantic_result)if "error" not in multimodal_result:print(f"\n📝 Original Content:")print(f"'{multimodal_result['original_content']['structured_data']['response']}'")print(f"\n🎨 Image Concept:")print(f"'{multimodal_result['image_prompt']}'")if "error" not in multimodal_result["image_result"]:print(f"✅ Image generated successfully!")# Display the image - Weave will show this in the dashboardgenerated_image = multimodal_result["generated_image"]if generated_image:print("🖼️ Generated image will appear in Weave dashboard")# You can also display it in Jupyter if running theretry:from IPython.display import displaydisplay(generated_image)except ImportError:passelse:print(f"❌ Image generation failed: {multimodal_result['image_result']['error']}")else:print(f"❌ Error: {multimodal_result['error']}")
다음과 같은 출력이 생성됩니다:

그리고 Weave에 로그를 남깁니다:

10단계: 종합 튜토리얼 요약
마지막 단계로, 이 튜토리얼에서 우리가 달성한 모든 내용을 개인화된 요약으로 정리하겠습니다. 특히 흥미로운 점은, 가장 높은 추론 노력 수준을 사용해 여러분의 경험을 가장 심도 있고 종합적으로 분석해 볼 것이라는 점입니다.
사용자 지정 어시스턴트는 여러분이 부여한 역할부터 구체적으로 요청한 내용까지, 전체 세션을 되돌아보며 여러분의 사용 사례에서 GPT-5의 다양한 기능이 어떻게 작동했는지에 대한 인사이트를 제공합니다.
@weave.op()def create_personalized_tutorial_summary(assistant_prompt: str, user_prompt: str) -> dict:"""Generate a personalized summary of your GPT-5 tutorial experience"""summary_request = f"""Based on our tutorial session where you were '{assistant_prompt}' and I asked you to '{user_prompt}',please summarize what we accomplished with GPT-5's features:1. Basic Responses API with custom role prompts2. Reasoning effort level comparisons (low/medium/high)3. Structured JSON output generation4. Multimodal content creation with image generation5. Advanced prompt engineering techniquesReflect on how your specific role affected the outputs and what developers can learn."""response = client.responses.create(model="gpt-5",reasoning={"effort": "high"}, # Use high effort for final summaryinput=[{"role": "developer","content": f"{assistant_prompt} Provide a thoughtful, comprehensive summary with insights about the tutorial experience."},{"role": "user","content": summary_request}])return {"personalized_summary": response.output_text,"original_assistant_role": assistant_prompt,"original_user_request": user_prompt,"tutorial_features": ["Custom role-based prompting","Responses API usage","Reasoning effort controls","Structured JSON outputs","Image generation integration","Multimodal content creation","Comprehensive Weave logging"]}final_summary = create_personalized_tutorial_summary(gpt_assistant_prompt, gpt_user_prompt)print("🎯 Your Personalized Tutorial Summary:")print(final_summary["personalized_summary"])print(f"\n📊 Session Details:")print(f"Your Assistant Role: {final_summary['original_assistant_role']}")print(f"Your Request: {final_summary['original_user_request']}")print(f"Features Explored: {', '.join(final_summary['tutorial_features'])}")
이를 통해 다음을 얻습니다:

그리고 Weave에 로그되었습니다:

11단계: Weave에서 작업 검토하기
이 튜토리얼을 완료했거나 자체 프로젝트를 진행한 후에는, 여러분의 Weave 대시보드는 종합적인 연구 노트처럼 변합니다. 데코레이터가 적용된 모든 함수는 @weave.op() 자동으로 로그되어 GPT-5 실험에서 생성된 풍부한 데이터셋이 만들어졌습니다.
대시보드에서 다음을 확인할 수 있습니다:
- 작업 트레이스: 모든 API 호출의 입력·출력을 완전하게 로깅하기
- 성능 지표: 다양한 접근 방식별 토큰 사용량, 지연 시간, 그리고 추론 노력 비용
- 나란히 비교하기: 낮음·보통·높음 추론 노력에서 어시스턴트가 어떻게 수행했는지
- 멀티모달 추적: 텍스트 생성 호출과 이미지 생성 시도 나란히 실행
- 오류 처리: 실패한 API 호출과 해당 오류 메시지
- 구조화된 데이터 검증: 스키마 준수 검증이 포함된 JSON 출력
이는 특정 사용 사례에 맞춰 GPT-5를 최적화하는 방법을 이해하고, 다양한 접근 방식의 비용과 성능을 비교하며, 발견한 내용을 팀원들과 공유할 수 있는 귀중한 자료를 만들어 줍니다.
결론
이제 당신은 성능과 비용을 최적화하는 추론 노력 제어부터, 파싱 문제를 없애는 보장된 구조화 출력, 아이디어를 시각적으로 구현하는 매끄러운 멀티모달 콘텐츠 생성까지, GPT-5의 가장 강력한 기능들을 완벽히 익혔습니다. 당신은 다음을 해냈습니다:
- 당신만의 성격과 전문성을 담은 맞춤형 AI 어시스턴트 구축
- 애플리케이션을 절대 깨뜨리지 않는 완벽한 구조의 JSON 생성
- 텍스트 콘텐츠를 지능적으로 보완하는 이미지를 ���성했습니다
- 품질, 속도, 비용의 균형을 위해 추론 노력 수준을 비교했습니다
- 완전한 가시성과 협업을 위해 Weave에 모든 항목을 기록했습니다
이제 다음을 진행할 시간입니다:
- 이들을 프로덕션 애플리케이션에 통합하세요
- 특정 사용 사례에 맞는 다양한 어시스턴트 역할을 실험해 보세요
- 신뢰할 수 있는 AI 기능을 구축하려면 구조화된 출력을 사용하세요
- 추론 제어를 활용해 API 비용을 최적화하세요
그리고 W&B Weave가 도움을 드립니다.
GPT-5는 단순한 모델 업데이트가 아니라, 더 신뢰 가능하고 제어 가능하며 비용 효율적인 AI 개발로의 근본적인 전환입니다. 여기서 배운 멀티모달 워크플로와 보장된 출력은 차세대 애플리케이션의 토대가 될 것입니다.
아래 댓글로 다음에 무엇을 멋지게 만들 계획인지 알려주세요!
관련 읽을거리
Attribute-Value Extraction With GPT-3 and Weights & Biases
In this article, we learn how to fine-tune OpenAI's GPT-3 for attribute-value extraction from products, looking at the challenges and how to overcome them.
Automating Change Log Tweets with Few-Shot Learning and GPT-3
A text summarization recipe using OpenAI GPT-3's few-shot learning and Weights & Biases
o1 model Python quickstart using the OpenAI API
Getting set up and running the new o1 models in Python using the OpenAI API. We'll be working with o1-preview.
Add a comment