Skip to Content
GPT API를 활용한 인공지능 앱 개발(2판)
book

GPT API를 활용한 인공지능 앱 개발(2판)

by 올리비에 케일린, 마리 알리스 블레트, 이일섭, 박태환
December 2024
Beginner to intermediate
320 pages
7h 25m
Korean
Hanbit Media, Inc.
Content preview from GPT API를 활용한 인공지능 앱 개발(2판)
239
5
프레임워크로 LLM 기능 높이기
PromptTemplate
은 모델을 위한 입력을 구성하는 역할을 합니다. 이는 프롬프트를 생성하는
재현 가능한
reproducible
방법입니다. 그 안에는
input
_
variables
를 통해 값을 지정하는 텍스트
문자열
template
이 있습니다. 프롬프트에 ‘단계별로 생각하세요’를 추가해 그에 맞게 출력값
이 생성되도록 합니다.
이 예시에서 사용된
LLM
GPT
-
4o
입니다. 모델은
ChatOpenAI
함수로
llm
변수에 정의됩
니다. 이 함수는 이전 장에서 다룬 예시처럼 환경 변수(
OPENAI
_
API
_
KEY
)에 오픈
AI
API
가 설정됐다고 가정합니다.
LLMChain
함수는 프롬프트와 모델을 연결합니다.
run
함수를 호출하면 이 함수는 입력된 값
들로 프롬프트를
LLM
에 전달해 답변받습니다. 이때 모델은 ‘단계별로 생각하세요’라는 규칙에
따라 질문에 답합니다.
이렇듯 동적 프롬프트를 사용하면 간단하게 복잡한 애플리케이션을 구축하거나 효율적인 프롬
프트 관리를 할 수 있습니다.
5.1.3
에이전트와 도구
에이전트와 도구는 랭체인 프레임워크의 핵심 기능으로, 이를 활용하면
LLM
이 더 강력한 작업
을 수행하고 다양한 기능과 통합해 복잡한 문제를 해결할 수 있습니다.
에이전트
agent
는 환경과 상호작용할 수 있는 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

개발 7년차, 매니저 1일차

개발 7년차, 매니저 1일차

권원상, 한민주, 카미유 푸르니에
GPT-4를 활용한 인공지능 앱 개발

GPT-4를 활용한 인공지능 앱 개발

올리비에 케일린, 마리 알리스 블레트

Publisher Resources

ISBN: 9791169213295