You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-8Lines changed: 32 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -129,11 +129,35 @@ This operator let's you ask a question for each item in a collection.
129
129
varanswers=items.Answer<float>(model, "What is the cost?");
130
130
```
131
131
132
-
# Defining new operators
133
-
All of these operators are built up of 2 core operators
134
-
****TransformItem()/TransformItemAsync()*** - which allows you to give a transformation goal and instructions for a single item.
135
-
****TransformItems()*** - Which allows you a transformation goal and instructions for each element in a enumerable collection.
132
+
# Model Extensions
133
+
All of these extensions are built up using 3 ChatClient extensions as primitives.
134
+
135
+
| Extension | Description |
136
+
| ----------| ------------|
137
+
|***.Generate()/.GenerateAsync()***| use a model and a goal to return a shaped result. |
138
+
|***.TransformItem()/.TransformItemAsync()***| use a model, object and goal to transform object into shaped result. |
139
+
|***.TransformItems()/.TransformItemsAsync()***| use a model, collection and goal to transform each object in the collection into a collection of shaped results. |
140
+
141
+
## model.Generate()/model.GenerateAsync()
142
+
Given a model and a goal return a shaped result.
143
+
```csharp
144
+
varnames=model.Generate<string[]>("funny names for people named bob");
145
+
varcities=model.Generate<City>("return the top 5 largest cities in the world.");
@@ -166,7 +166,7 @@ public void Transform_Collection_Object2Object()
166
166
newSourceObject(){Title="Title 3",Description="Which is better? Flossing or brushing or doing nothing?",Writer="Gert Gooble",PubliicationDate=newDateTime(2020,10,1)},
0 commit comments