АДРЕСНЫЙ РЕЖИМ - локальная подель на декомпозе
This commit is contained in:
@@ -27,10 +27,30 @@ async function request<T>(path: string, init?: RequestInit): Promise<T> {
|
||||
}
|
||||
|
||||
export const apiClient = {
|
||||
async testConnection(connection: ConnectionState): Promise<{ ok: boolean; model: string; timestamp: string }> {
|
||||
return request("/openai/test-connection", {
|
||||
async listModels(connection: ConnectionState): Promise<{ ok: boolean; models: string[]; count: number; timestamp: string }> {
|
||||
return request("/llm/models", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
llmProvider: connection.llmProvider,
|
||||
apiKey: connection.apiKey,
|
||||
model: connection.model,
|
||||
baseUrl: connection.baseUrl
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
async testConnection(connection: ConnectionState): Promise<{
|
||||
ok: boolean;
|
||||
provider: "openai" | "local";
|
||||
model: string;
|
||||
model_found: boolean | null;
|
||||
models_count: number | null;
|
||||
timestamp: string;
|
||||
}> {
|
||||
return request("/llm/test-connection", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
llmProvider: connection.llmProvider,
|
||||
apiKey: connection.apiKey,
|
||||
model: connection.model,
|
||||
baseUrl: connection.baseUrl
|
||||
@@ -54,6 +74,7 @@ export const apiClient = {
|
||||
return request("/normalize", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
llmProvider: params.connection.llmProvider,
|
||||
apiKey: params.connection.apiKey,
|
||||
model: params.connection.model,
|
||||
baseUrl: params.connection.baseUrl,
|
||||
@@ -130,6 +151,7 @@ export const apiClient = {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
normalizeConfig: {
|
||||
llmProvider: input.connection.llmProvider,
|
||||
apiKey: input.connection.apiKey,
|
||||
model: input.connection.model,
|
||||
baseUrl: input.connection.baseUrl,
|
||||
@@ -203,12 +225,13 @@ export const apiClient = {
|
||||
mode: "assistant",
|
||||
message: input.userMessage,
|
||||
user_message: input.userMessage,
|
||||
llmProvider: input.connection.llmProvider,
|
||||
apiKey: input.connection.apiKey,
|
||||
model: input.connection.model,
|
||||
baseUrl: input.connection.baseUrl,
|
||||
temperature: input.connection.temperature,
|
||||
maxOutputTokens: input.connection.maxOutputTokens,
|
||||
promptVersion: input.promptVersion ?? "normalizer_v2_0_2",
|
||||
promptVersion: input.promptVersion ?? "address_query_runtime_v1",
|
||||
systemPrompt: input.prompts.systemPrompt,
|
||||
developerPrompt: input.prompts.developerPrompt,
|
||||
domainPrompt: input.prompts.domainPrompt,
|
||||
|
||||
Reference in New Issue
Block a user