Class OpenApiHelper
- Namespace
- Function
Calling
- Assembly
- AntRunnerLib.dll
Provides helper methods for validating and parsing OpenAPI specifications.
- Inheritance
-
System.
Object OpenApi Helper
- Inherited Members
-
System.
Object. Equals(System. Object) System.Object. Equals(System. Object, System. Object) System.Object. Get Hash Code() System.Object. Get Type() System.Object. Memberwise Clone() System.Object. Reference Equals(System. Object, System. Object) System.Object. To String()
Methods
GetRequestBuilders(JsonDocument, List<ToolDefinition>, String)
Generates request builders based on the OpenAPI specification.
public async Task<Dictionary<string, ActionRequestBuilder>> GetRequestBuilders(JsonDocument openapiSpec, List<ToolDefinition> toolDefinitions, string assistantName = null)
Parameters
openapiSpec
System.Text. Json. Json Document The OpenAPI specification as a System.
Text. .Json. Json Document toolDefinitions
List<ToolDefinition >The list of tool definitions extracted from the OpenAPI spec.
assistantName
System.String The assistant
Returns
- Task<Dictionary<System.
String , ActionRequest >>Builder A dictionary of Action
Request objects with operation IDs as keys.Builder
GetToolDefinitions(JsonDocument)
Extracts tool definitions from the OpenAPI specification.
Parameters
openapiSpec
System.Text. Json. Json Document The OpenAPI specification as a System.
Text. .Json. Json Document
Returns
- List<Tool
Definition > A list of Tool
Definition objects extracted from the OpenAPI spec.
ValidateAndParseOpenAPISpec(String)
Validates and parses the OpenAPI specification string.
Parameters
specString
System.String The OpenAPI specification string in JSON or YAML format.
Returns
- Validation
Result A Validation
Result indicating the validation result.