Skip to content

Commit

Permalink
Merge pull request #33 from D7EAD/v3.1.1-hotfix
Browse files Browse the repository at this point in the history
v3.1.1 Hotfix
  • Loading branch information
D7EAD authored Jun 12, 2023
2 parents d2221be + bf97d70 commit 1db973d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
10 changes: 6 additions & 4 deletions liboai/core/netimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1168,10 +1168,12 @@ void liboai::netimpl::Session::SetHeader(const components::Header& header) {
}
}

curl_slist* temp = curl_slist_append(this->headers, "Transfer-Encoding:chunked");
if (temp) {
this->headers = temp;
}
curl_slist* temp;
// Causes cURL error for simple GET requests
// curl_slist* temp = curl_slist_append(this->headers, "Transfer-Encoding: chunked");
// if (temp) {
// this->headers = temp;
// }

// remove preset curl headers for files >1MB
temp = curl_slist_append(this->headers, "Expect:");
Expand Down
13 changes: 13 additions & 0 deletions liboai/include/components/chat.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,19 @@ namespace liboai {
*/
LIBOAI_EXPORT bool Update(const Response& response) & noexcept(false);

/*
@brief Appends stream data (SSEs) from streamed methods.
This method updates the conversation given a token from a
streamed method. This method should be used when using
streamed methods such as ChatCompletion::create or
create_async with a callback supplied. This function should
be called from within the stream's callback function
receiving the SSEs.
@param *token The token to update the conversation with.
*/
// LIBOAI_EXPORT bool AppendToken(std::string_view token) & noexcept(false);

/*
@brief Returns the raw JSON dump of the internal conversation object
in string format.
Expand Down

0 comments on commit 1db973d

Please sign in to comment.