Type schema based on OpenAPI v3.0 for LLM function calling.
ILlmSchemaV3 is a type metadata for LLM (Large Language Model)
function calling, based on the OpenAPI v3.0 speicification. This type
is not the final type for the LLM function calling, but the intermediate
structure for the conversion to the final type like IGeminiSchema.
ILlmSchemaV3 basically follows the JSON schema definition of OpenAPI
v3.0 specification; OpenApiV3.IJsonSchema. However, ILlmSchemaV3
does not have the reference type; OpenApiV3.IJsonSchema.IReference.
It's because the LLM cannot compose the reference typed arguments. If
recursive type comes, its type would be repeated in
ILlmSchemaV3.IConfig.recursive times. Otherwise you've configured
it to false, the recursive types are not allowed.
For reference, the OpenAPI v3.0 based JSON schema definition can't
express the tuple array type. It has been supported since OpenAPI v3.1;
OpenApi.IJsonSchema.ITuple. Therefore, it would better to avoid
using the tuple array type in the LLM function calling.
Type schema based on OpenAPI v3.0 for LLM function calling.
ILlmSchemaV3
is a type metadata for LLM (Large Language Model) function calling, based on the OpenAPI v3.0 speicification. This type is not the final type for the LLM function calling, but the intermediate structure for the conversion to the final type like IGeminiSchema.ILlmSchemaV3
basically follows the JSON schema definition of OpenAPI v3.0 specification; OpenApiV3.IJsonSchema. However,ILlmSchemaV3
does not have the reference type; OpenApiV3.IJsonSchema.IReference. It's because the LLM cannot compose the reference typed arguments. If recursive type comes, its type would be repeated in ILlmSchemaV3.IConfig.recursive times. Otherwise you've configured it tofalse
, the recursive types are not allowed.For reference, the OpenAPI v3.0 based JSON schema definition can't express the tuple array type. It has been supported since OpenAPI v3.1; OpenApi.IJsonSchema.ITuple. Therefore, it would better to avoid using the tuple array type in the LLM function calling.
Also, if you configure ILlmSchemaV3.IConfig.constraint to
false
, these properties would be banned and written to the ILlmSchemaV3.__IAttribute.description property instead. It's because there are some LLM models which does not support the constraint properties.