diff --git a/composables/useFetchRequest.js b/composables/useFetchRequest.js
index 5d873093f4568f80048d0eca491c1c3b5e0bd4ad..0531269e493201b404e16d952b782ebaeddce17e 100644
--- a/composables/useFetchRequest.js
+++ b/composables/useFetchRequest.js
@@ -1,27 +1,17 @@
-const BASE_URL = 'http://localhost:3000';
+const BASE_URL = 'https://gpu-pod656e861afe3d944d6b3ce77e-7862.node.inscode.run';
const useFetchRequest = (baseUrl) => {
baseUrl = baseUrl || BASE_URL;
const config = {
headers: {}
};
- const loading = ref(false);
const fetchRequest = (url, fetchConfig) => {
url = `${BASE_URL}${url}`;
fetchConfig = fetchConfig || {};
fetchConfig.method = (fetchConfig.method || 'get').toLocaleUpperCase();
- if (!fetchConfig['Content-Type']) {
- fetchConfig['Content-Type'] = 'application/json';
- }
fetchConfig = Object.assign(config, fetchConfig);
- return $fetch(url, fetchConfig).then(async (response) => {
- console.log(`response:`, response)
- return response;
- }).finally(() => {
- loading.value = false
- })
+ return $fetch(url, fetchConfig);
}
return {
- loading,
fetchRequest
}
}
diff --git a/pages/index.vue b/pages/index.vue
index 2ae0f07811350966c3eb01cf907b0075d2de22d0..fb4290d0001003553f08564778a050aacab51f3f 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -24,10 +24,25 @@
diff --git a/pages/search/[id].vue b/pages/search/[id].vue
index 61dcd962a16e64468f4786b70cc3be8ffb381b89..4affa35c5ee475676980c1ab83372210958d7ebc 100644
--- a/pages/search/[id].vue
+++ b/pages/search/[id].vue
@@ -133,9 +133,11 @@
\ No newline at end of file
diff --git a/server/api/mock/[...slug].js b/server/api/mock/[...slug].js
index 51e2c61371fbeb112284ea4855dcf13ba0d78b72..ca5447bc617b5fcd030cb0a83d93e0b1ee78315d 100644
--- a/server/api/mock/[...slug].js
+++ b/server/api/mock/[...slug].js
@@ -3,7 +3,7 @@ import { createRouter, defineEventHandler, useBase } from 'h3'
const router = createRouter()
router.get('/test', defineEventHandler(() => {
- return { data: 'Hello World' }
+ return 'data:{"message":"success","data":{"id":"c_20240516095719_bfaJkBJyg4KTwL8g","object":"chat.completion","created":1715824958,"model":"chat_qwen110b","choices":[{"index":0,"message":{"role":"assistant","content":"Hello! I\'m here to help you with any questions or tasks related to the Byzer-LLM project or its usage. Whether you need assistance with deployment, querying models, understanding the integration process, or exploring its features, feel free to ask. For instance, if you\'re looking to set up a model like `sparkdesk_chat`, run a simple inference, validate the model, or even understand how to use Python scripts for interacting with Byzer-LLM, just let me know your specific inquiry!"},"finish_reason":"stop"}],"usage":{"prompt_tokens":6653,"completion_tokens":104,"total_tokens":6757},"meta":{"type":"answer"}}}';
}))
export default useBase('/api/mock', router.handler)