이 문서는 영어 원문을 자동 번역한 것으로, 내용이 원문과 다를 수 있습니다.영어 원문 보기
워크플로우의 처리 단계를 새 설정 버전으로 저장합니다.
POST/agents/{agent_id}/configs
Authorization
필수
Bearer <token>위치: header
application/json필수
steps
필수
array<object>처리 단계 목록입니다. 종류별 설정은 처리 단계 구성을 참고하세요.
is_defaultboolean
실행 요청에서 config_id를 생략할 때 이 버전을 사용할지 지정합니다.
기본값: true
namestring | null
설정 버전의 이름입니다.
기본값: null
agent_id
필수
string워크플로우 생성 시 반환된 ID입니다.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["UPSTAGE_API_KEY"],
base_url="https://api.upstage.ai/v2",
)
response = client.post(
"/agents/agt_example/configs",
cast_to=dict[str, object],
body={
"name": "Parse v1",
"is_default": True,
"steps": [
{
"name": "Parse",
"type": "document-parse",
"data": {"model": "default"},
"is_first": True,
"next_steps": [],
}
],
},
)
print(response)
{
"id": "cfg_example",
"object": "config",
"agent_id": "agt_example",
"external_id": "1",
"name": "Parse v1",
"is_default": true,
"steps": [
{
"id": "step_example",
"name": "Parse",
"type": "document-parse",
"data": {
"model": "default"
},
"is_first": true,
"next_steps": [],
"node_id": null
}
],
"created_at": 1794873600,
"updated_at": 1794873600
}
시작 단계는 하나이며 단계 이름은 중복될 수 없습니다. next_steps[].step_name은 같은 설정의 단계를 가리켜야 하고 순환 연결은 허용하지 않습니다. 종류별 설정은 처리 단계 구성을 참고하세요.
| 오류 코드 | 원인 |
|---|
config_steps_empty | 처리 단계가 없습니다. |
config_first_step_invalid | 시작 단계가 없거나 여러 개입니다. |
config_step_name_duplicate | 단계 이름이 중복됩니다. |
config_next_step_not_found | 다음 단계가 존재하지 않습니다. |
config_graph_cyclic | 단계 연결에 순환이 있습니다. |
config_step_data_invalid | 처리 종류에 맞지 않는 설정입니다. |
위 오류는 HTTP 400, error.param="steps"를 반환합니다. error.details가 있으면 문제가 있는 단계를 확인할 수 있습니다.