feat: Integrate with `/tools` endpoint
This commit is contained in:
parent
8d0eb1aaaf
commit
684ed10a04
|
|
@ -4,5 +4,9 @@ export const API_MODELS = {
|
|||
UNLOAD: '/models/unload'
|
||||
};
|
||||
|
||||
export const API_TOOLS = {
|
||||
LIST: '/tools'
|
||||
};
|
||||
|
||||
/** CORS proxy endpoint path */
|
||||
export const CORS_PROXY_ENDPOINT = '/cors-proxy';
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
import { apiFetch } from '$lib/utils';
|
||||
import { API_TOOLS } from '$lib/constants';
|
||||
import type { OpenAIToolDefinition } from '$lib/types';
|
||||
|
||||
export class ToolsService {
|
||||
/**
|
||||
* Fetch the list of built-in tools from the server.
|
||||
*
|
||||
* @returns Array of tool definitions in OpenAI-compatible format
|
||||
*/
|
||||
static async list(): Promise<OpenAIToolDefinition[]> {
|
||||
return apiFetch<OpenAIToolDefinition[]>(API_TOOLS.LIST);
|
||||
}
|
||||
}
|
||||
|
|
@ -161,6 +161,7 @@ export default defineConfig({
|
|||
'/v1': 'http://localhost:8080',
|
||||
'/props': 'http://localhost:8080',
|
||||
'/models': 'http://localhost:8080',
|
||||
'/tools': 'http://localhost:8080',
|
||||
'/cors-proxy': 'http://localhost:8080'
|
||||
},
|
||||
headers: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue