MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / postStream

Function postStream

ui/src/request/index.ts:207–224  ·  view source on GitHub ↗
(
  url,
  data,
)

Source from the content-addressed store, hash-verified

205 * @returns
206 */
207export const postStream: (url: string, data?: unknown) => Promise<Result<any> | any> = (
208 url,
209 data,
210) => {
211 const { user, login } = useStore()
212 const token = login.getToken()
213 const language = user.getLanguage()
214 const headers: HeadersInit = { 'Content-Type': 'application/json' }
215 if (token) {
216 headers['AUTHORIZATION'] = `Bearer ${token}`
217 }
218 headers['Accept-Language'] = `${language}`
219 return fetch(url, {
220 method: 'POST',
221 body: data ? JSON.stringify(data) : undefined,
222 headers: headers,
223 })
224}
225
226export const exportExcel: (
227 fileName: string,

Callers 11

chatFunction · 0.90
generateCodeFunction · 0.90
debugToolWorkflowFunction · 0.90
generate_promptFunction · 0.90
chatFunction · 0.90
generate_promptFunction · 0.90
chatFunction · 0.90
generateCodeFunction · 0.90
debugToolWorkflowFunction · 0.90
debugToolWorkflowFunction · 0.90
generateCodeFunction · 0.90

Calls 1

useStoreFunction · 0.85

Tested by

no test coverage detected