API
API
AIModelImpl

AIModelImpl

subclasses AILocalModelImpl, AIRemoteModelImpl

PivotAIModel ๊ตฌํ˜„์ฒด์˜ ๊ณตํ†ต ๋ฒ ์ด์Šค.
name/description, ๋“ฑ๋ก๋œ ๋ช…๋ น ์บ์‹œ, registerCommands ํ๋ฆ„(์„œ๋ฒ„ ์ „์†ก โ†’ ์บ์‹œ ๊ฐฑ์‹ ), AICommand โ†’ JSONSchema ๋ณ€ํ™˜์„ ์ œ๊ณตํ•œ๋‹ค.
์‹ค์ œ ์ „์†ก(_doRegisterCommands)๊ณผ ์งˆ์˜(call)๋Š” ์„œ๋ธŒํด๋ž˜์Šค๊ฐ€ ๊ตฌํ˜„ํ•œ๋‹ค.

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)