You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Thanks for creating this repo! Very useful for any react Chat interface.
I found the method parameter seems a bit redundant. In the example code, you have something like this below.
Hi,
Thanks for creating this repo! Very useful for any react Chat interface.
I found the method parameter seems a bit redundant. In the example code, you have something like this below.
options: {
url: 'http://127.0.0.1:8000/chat',
method: 'POST',
headers:{
'Accept': 'application/json'
},
body: {
'query': 'Hello! how are you'
}
},
method: {
type: 'body',
key: 'query'
},
}
However, in the getStream function below, only the 'options' parameter is used.
export const getStream = async (input: string, options: UseChatStreamHttpOptions, method: UseChatStreamInputMethod) => {
options = mergeInputInOptions(input, options, method);
const params = '?' + new URLSearchParams(options.query).toString();
const response = await fetch(options.url + params, {
method: options.method,
headers: { ...DEFAULT_HEADERS, ...options.headers },
body: JSON.stringify(options.body, (_k, v) => v === null ? undefined : v)
});
if (!response.ok) throw new Error(response.statusText);
return response.body;
};
The text was updated successfully, but these errors were encountered: