API
API
Classes
AIRemoteModelImpl

AIRemoteModelImpl extends AIModelImpl

원격 서버를 경유하여 LLM을 호출하는 AIRemoteModel 구체 구현.
통신은 fetch로 직접 수행하며, 와이어 프로토콜은 다음과 같다:

  • 명령 등록: POST {url}/{commandsPath} 본문 { tools, clear } (tools는 AICommand를 JSONSchema tool 정의로 변환한 배열)
  • 컨텍스트 등록: POST {url}/{contextPath} 본문 { systemContext, reasonInstruction } (tools와 동일하게 세션에 한 번 등록하며, 변경되었을 때만 다음 질의 직전에 전송. reasonInstruction은 message/도구별 reason의 역할 계약으로, 서버가 프롬프트에 주입한다)
  • 질의: POST {url}/{queryPath} 본문 { query } → 응답 본문이 AIResponse
    응답이 2xx가 아니거나 본문 parse에 실패하면 예외를 throw한다.
    등록된 명령은 UI 표시 등을 위해 로컬에도 캐시하며(베이스 처리), 서버 등록이 성공한 경우에만 갱신한다.
    서버가 세션별로 tools/컨텍스트를 보관한다는 전제(stateful)이며, 매 질의에 컨텍스트를 재전송하지 않는다.

Properties

systemContext: string (opens in a new tab) readonly

호출 측(피벗)이 설정하는 시스템 컨텍스트.
데이터 필드 메타·동작 지시문 등을 담으며, LLM 호출 시 system 메시지로 사용된다.

default: undefined

tools: Array (opens in a new tab)<AIToolSchema> readonly

모델에 등록된 도구 목록.

default: undefined

Methods

call(api, query, toolChoice?): Promise (opens in a new tab)<AIConversationTurn>

사용자의 자연어 요청을 전달하고 LLM의 응답을 받는다.

ParameterType
apiPivotAIApi
querystring (opens in a new tab)
toolChoiceAIToolChoice

dispose(): null

객체를 해제하고 null을 반환한다.
사용 예: this._obj = this._obj.dispose();

return null

registerTools(tools, clear?): Promise (opens in a new tab)<void (opens in a new tab)>

명령(도구) 목록을 등록한다.
전송(_doRegisterTools)이 성공한 경우에만 로컬 캐시를 갱신한다.
clear가 true이면 기존 목록을 비운 뒤 등록하고, false(기본)이면 추가한다.

ParameterType
toolsArray (opens in a new tab)<AIToolSchema>
clearboolean (opens in a new tab)

setDeveloperContext(context?): void (opens in a new tab)

개발자 컨텍스트를 설정한다(개발자 관련 정보가 필요할 때 호출 측에서 지정).
undefined를 전달하면 컨텍스트를 해제한다.

ParameterType
contextstring (opens in a new tab)

setSystemContext(context?): void (opens in a new tab)

시스템 컨텍스트를 설정한다(피벗 데이터·필드가 정해질 때 호출 측에서 지정).
undefined를 전달하면 컨텍스트를 해제한다.

ParameterType
contextstring (opens in a new tab)