Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
v4.0.0
focuses mainly on the new OpenAIfunctions
capability for their Chat endpoint. You can read about it here.Basic additions/changes:
NON_MOVABLE
.NON_COPYABLE
.stream
parameters that can equal:ChatStreamCallback
which expands tostd::function<std::string, intptr_t, Conversation&>
,StreamCallback
which expands tostd::function<std::string, intptr_t>
.ChatStreamCallback
applies toConversation
-related streamable methods, andStreamCallback
applies to all other streamable methods.ChatCompletions::create
andcreate_async
:function_call
, an optional parameter that tells the model whichfunction
to use in their response, if any. Should be eithernone
,auto
(default), or the name of a previously setfunction
the response should use. Afunction
should be set in theConversation
passed to this method prior to calling it.New classes, methods:
Functions
:Functions::FunctionParameter
.FunctionParameter
, which describes a single parameter of a set function in the classFunctions
.bool AddFunction(...)
,bool AddFunctions(...)
,bool PopFunction(...)
,bool PopFunctions(...)
,bool SetDescription(...)
,bool PopDescription(...)
,bool SetRequired(...)
,bool PopRequired(...)
,bool AppendRequired(...)
,bool SetParameter(...)
,bool SetParameters(...)
,bool PopParameters(...)
,bool AppendParameter(...)
,bool AppendParameters(...)
,const nlohmann::json& GetJSON(...)
struct FunctionParameter
Conversation
Methods:bool AddUserData(string_view data, string_view name)
,bool LastResponseIsFunctionCall(...)
,std::string GetLastFunctionCallName(...)
,std::string GetLastFunctionCallArguments(...)
,std::string Export(...)
,bool Import(...)
,bool AppendStreamData(...)
,bool SetFunctions(...)
,bool PopFunctions(...)
,std::string GetRawFunctions(...)
,const nlohmann::json& GetFunctionsJSON(...)