feat(stage1): этап 1 — извлечение resource_type через LLM по списку реальных ресурсов
This commit is contained in:
@@ -270,7 +270,8 @@ function createSemaphore(max) {
|
||||
* baseUrl?:string,
|
||||
* apiKey?:string,
|
||||
* model?:string,
|
||||
* temperature?:number
|
||||
* temperature?:number,
|
||||
* responseFormat?:{type:string} // напр. {type:'json_object'}
|
||||
* }} params
|
||||
* @returns {Promise<string>} — содержимое choices[0].message.content
|
||||
*/
|
||||
@@ -282,6 +283,7 @@ async function llmChat({
|
||||
apiKey = ENV.LLM_API_KEY,
|
||||
model = ENV.LLM_MODEL,
|
||||
temperature,
|
||||
responseFormat,
|
||||
}) {
|
||||
const base = String(baseUrl).replace(/\/+$/, '');
|
||||
const url = `${base}/v1/chat/completions`;
|
||||
@@ -293,6 +295,9 @@ async function llmChat({
|
||||
if (temperature !== undefined && temperature !== null) {
|
||||
payload.temperature = temperature;
|
||||
}
|
||||
if (responseFormat !== undefined && responseFormat !== null) {
|
||||
payload.response_format = responseFormat;
|
||||
}
|
||||
|
||||
const signal = controller ? controller.signal : undefined;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user