Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ The following examples demonstrate how to use JsonTranslator, Schemas and Vocabu

### Hierarchical schemas
* [MultiSchema](./examples/MultiSchema): dynamically route user intent to other 'sub-apps'
* [SchemaHierarchy](./examples/SchemaHierarchy): A Json Translator than uses multiple child JsonTranslators

These examples also how [TextClassification](./examples/typechat.examplesLib/Classification) classes can be used to route text inputs to handlers.
* [SchemaHierarchy](./examples/SchemaHierarchy): A Json Translator than uses multiple child JsonTranslators. For each user request, it picks the semantically ***nearest*** child translator and routes the input to it.
* [TextClassification](./examples/typechat.examplesLib/Classification) and [VectorTextIndex](./examples/typechat.examplesLib/VectorTextIndex.cs) show how to build a simple classifiers to route input.

### Json Programs

Expand Down
2 changes: 2 additions & 0 deletions examples/typechat.examplesLib/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Example classes include:

* **HierarchicalJsonTranslator**: demonstrates how a translator can use an in-memory vector index to semantically route request to child translators

* **VectorizedTextIndex**: Demonstrates how to use an in-memory vectorized text index to route text requests

* **PluginProgramTranslator**: Program translator that translates user requests into programs that call APIs defined by Microsoft Semantic Kernel Plugins

* **PluginProgramValidator**: Validates programs produced by PluginProgramTranslator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

using Microsoft.TypeChat.Schema;

namespace Microsoft.TypeChat;
namespace Microsoft.TypeChat.Schema;

/// <summary>
/// Terminals, Operators etc, used to export Typescript
Expand Down Expand Up @@ -56,31 +54,31 @@ public static class Types
{
if (type.IsString())
{
return Types.String;
return String;
}
else if (type.IsEnum)
{
return null;
}
else if (type.IsNumber())
{
return Types.Number;
return Number;
}
else if (type.IsBoolean())
{
return Types.Boolean;
return Boolean;
}
else if (type.IsDateTime())
{
return Types.String; // Json does not have a primitive DateTime
return String; // Json does not have a primitive DateTime
}
else if (type.IsObject())
{
return Types.Any;
return Any;
}
else if (type.IsVoid())
{
return Types.Void;
return Void;
}
return null;
}
Expand Down