-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
1,533 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "common/assistant_tool.h" | ||
|
||
namespace OpenAi { | ||
struct AssistantCodeInterpreterTool : public AssistantTool { | ||
AssistantCodeInterpreterTool() : AssistantTool("code_interpreter") {} | ||
|
||
AssistantCodeInterpreterTool(AssistantCodeInterpreterTool&) = delete; | ||
|
||
AssistantCodeInterpreterTool& operator=(AssistantCodeInterpreterTool&) = | ||
delete; | ||
|
||
AssistantCodeInterpreterTool(AssistantCodeInterpreterTool&&) = default; | ||
|
||
AssistantCodeInterpreterTool& operator=(AssistantCodeInterpreterTool&&) = | ||
default; | ||
|
||
~AssistantCodeInterpreterTool() = default; | ||
|
||
static cpp::result<AssistantCodeInterpreterTool, std::string> FromJson( | ||
const Json::Value& json) { | ||
if (json.empty()) { | ||
return cpp::fail("Empty JSON"); | ||
} | ||
AssistantCodeInterpreterTool tool; | ||
return std::move(tool); | ||
} | ||
|
||
cpp::result<Json::Value, std::string> ToJson() override { | ||
Json::Value json; | ||
json["type"] = type; | ||
return json; | ||
} | ||
}; | ||
} // namespace OpenAi |
Oops, something went wrong.