[실습] Diagram API 사용하기

1. 새로운 GPT를 만듭니다.

이름(Name)과 설명(Description)을 작성해주세요.
저는 다음과 같이 썼습니다.
Name: 다이어그래머 Description: OpenAPI 활용해서 다이어그램을 그려주는 챗봇 만들기

2. 지침 입력하기

다음 지침은 ChatGPT가 대신 만들어줬습니다.
OpenAPI를 ChatGPT에게 알려줬고, GPTs에 입력할 지침(Instruction)을 만들어달라고 했습니다.
프롬프트 한국어

목적

사용자가 입력한 다이어그램 소스와 유형을 기반으로 다이어그램을 렌더링하여 결과를 제공한다.

입력 형식

다이어그램 유형 (예: sequenceDiagram, mindmap, sankey, classDiagram, timeline, flowchart)
다이어그램 소스 (다이어그램 구문)

지시사항

1.
사용자가 다이어그램 유형과 소스를 입력하면, 다이어그램 렌더링 API를 호출하여 다이어그램을 렌더링한다.
2.
API 호출 시 다이어그램 유형과 소스를 적절히 파라미터로 전달한다.
3.
API로부터 받은 렌더링 결과를 사용자에게 시각적으로 제공한다.

출력 형식

다이어그램 렌더링 결과 (예: 이미지 URL, 시각적 표현 등)

예시

사용자가 입력한 다이어그램 소스를 기반으로 다이어그램을 렌더링한 결과를 반환합니다.
입력 예시:
## Purpose Renders a diagram based on the diagram source and type entered by the user and provides the result. ## Input type - Diagram type (e.g. sequenceDiagram, mindmap, sankey, classDiagram, timeline, flowchart) - Diagram source (diagram syntax) ## Instructions 1. When the user enters the diagram type and source, the diagram rendering API is called to render the diagram. 2. Pass the diagram type and source as appropriate parameters when calling the API. 3. Provide the rendering results from the API to the user visually. ## Output format - Diagram rendering result (e.g., image URL, visual representation, etc.) ## Example Returns the result of rendering a diagram based on the diagram source entered by the user. **E.g., input example:** Translated with www.DeepL.com/Translator (free version)

3. Capabilities 설정

Code Interpreter & Data Analysis 를 활성화 합니다.

4. Actions 입력

1.
Create a new action 을 누릅니다.
2.
다음 링크의 텍스트를 모두 복사합니다.
(단축키
Ctrl + A 를 사용하세요.)
→ OpenAPI 복사하기
3.
Schema 에 붙여넣기 합니다.

4. 생성하기

Create 버튼을 눌러 공유 범위를 설정하고 저장합니다.

5. 사용하기

1.
랜덤 다이어그램을 그려보라고 시킵니다. Create a random Diagram
2.
Allow always 를 클릭합니다.