Skip to content

Commit 7c1458f

Browse files
committed
docs: add migration guide for vis rec 4.0.0
1 parent 4a86839 commit 7c1458f

File tree

1 file changed

+230
-0
lines changed

1 file changed

+230
-0
lines changed

MIGRATION-v4.md

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
### Unity SDK V4 Migration guide
2+
3+
#### Authentication
4+
5+
##### v3.x.x
6+
7+
Previously different `Config` objects were used for authentication.
8+
9+
```cs
10+
void Example()
11+
{
12+
TokenOptions iamTokenOptions = new TokenOptions(
13+
Apikey: "{iam-apikey}"
14+
);
15+
service = new AssistantService("{versionDate}", iamTokenOptions);
16+
service.SetEndpoint("{service-endpoint}");
17+
}
18+
```
19+
20+
Or constructors accepted `TokenOptions` or `username` and `password`.
21+
22+
```cs
23+
void Example()
24+
{
25+
service = new AssistantService("{tokenOptions}", "{versionDate}");
26+
service2 = new DiscoveryService("{username}", "{password}", "{versionDate}");
27+
}
28+
```
29+
30+
##### v4.x.x
31+
32+
Now we use an `Authenticator` to authenticate the service. Available authentication schemes include `IamAuthenticator`, `BasicAuthenticator`, `CloudPakForDataAuthenticator` and `BearerTokenAuthenticator`
33+
34+
###### IamAuthenticator
35+
36+
```cs
37+
void Example()
38+
{
39+
IamAuthenticator authenticator = new IamAuthenticator(
40+
apikey: "{apikey}"
41+
);
42+
var service = new AssistantService("{versionDate}", authenticator);
43+
service.SetServiceUrl("{serviceUrl}");
44+
}
45+
```
46+
47+
##### BasicAuthenticator
48+
49+
```cs
50+
void Example()
51+
{
52+
BasicAuthenticator authenticator = new BasicAuthenticator(
53+
username: "{username}",
54+
password: "{password}"
55+
);
56+
var service = new AssistantService("{versionDate}", authenticator);
57+
service.SetServiceUrl("{serviceUrl}");
58+
}
59+
```
60+
61+
###### BearerTokenAuthenticator
62+
63+
```cs
64+
void Example()
65+
{
66+
BearerTokenAuthenticator authenticator = new BearerTokenAuthenticator(
67+
bearerToken: "{bearerToken}"
68+
);
69+
var service = new AssistantService("{versionDate}", authenticator);
70+
service.SetServiceUrl("{serviceUrl}");
71+
}
72+
```
73+
74+
###### CloudPakForDataAuthenticator
75+
76+
```cs
77+
void Example()
78+
{
79+
CloudPakForDataAuthenticator authenticator = new CloudPakForDataAuthenticator(
80+
url: "https://{cp4d_cluster_host}{:port}",
81+
username: "{username}",
82+
password: "{password}"
83+
);
84+
var service = new AssistantService("{version-date}", authenticator);
85+
service.SetServiceUrl("{serviceUrl}");
86+
var results = service.Message("{workspace-id}", "{message-request}");
87+
}
88+
```
89+
90+
Constructors that did not take an `Authenticator` were removed.
91+
92+
#### Supplying credentials
93+
94+
You can supply credentials to your service using external `ibm-credentials.env` files.
95+
96+
```cs
97+
AssistantService service = new AssistantService("{version-date}");
98+
var listWorkspacesResult = service.ListWorkspaces();
99+
```
100+
101+
##### v3.x.x
102+
103+
Previously we would look for these files first in the system `home` directory, followed by the current project directory.
104+
105+
##### v4.x.x
106+
Now in order to allow developers to have different configurations for each project we look first in the current project directory, followed by the home directory.
107+
108+
#### Setting the service url
109+
110+
##### v3.x.x
111+
112+
Previously we set the service url via SetEndpoint() method.
113+
114+
```cs
115+
void Example()
116+
{
117+
TokenOptions iamTokenOptions = new TokenOptions(
118+
apikey: "{iam-apikey}"
119+
);
120+
service = new AssistantService("{versionDate}", iamTokenOptions);
121+
service.SetEndpoint("{service-endpoint}");
122+
}
123+
```
124+
125+
##### v4.x.x
126+
127+
Now we set the service url via the SetServiceUrl() method.
128+
129+
```cs
130+
void Example()
131+
{
132+
IamAuthenticator authenticator = new IamAuthenticator(
133+
apikey: "{apikey}"
134+
);
135+
var service = new AssistantService("{versionDate}", authenticator);
136+
service.SetServiceUrl("{serviceUrl}");
137+
}
138+
```
139+
140+
#### Service changes
141+
142+
##### Assistant v1
143+
144+
* `includeCount` is no longer a parameter of the `ListWorkspaces()` method
145+
* `includeCount` is no longer a parameter of the `ListIntents()` method
146+
* `includeCount` is no longer a parameter of the `ListExamples()` method
147+
* `includeCount` is no longer a parameter of the `ListCounterexamples()` method
148+
* `includeCount` is no longer a parameter of the `ListEntities()` method
149+
* `includeCount` is no longer a parameter of the `ListValues()` method
150+
* `includeCount` is no longer a parameter of the `ListSynonyms()` method
151+
* `includeCount` is no longer a parameter of the `ListDialogNodes()` method
152+
* `valueType` was renamed to `type` in the `CreateValue()` method
153+
* `newValueType` was renamed to `newType` in the `UpdateValue()` method
154+
* `nodeType` was renamed to `type` in the `CreateDialogNode()` method
155+
* `nodeType` was renamed to `type` in the `CreateDialogNode()` method
156+
* `newNodeType` was renamed to `newType` in the `UpdateDialogNode()` method
157+
* `ValueTypeEnumValue` was renamed to `TypeEnumValue` in the `CreateValue` model
158+
* `ValueType` was renamed to `Type` in the `CreateValue` model
159+
* `NodeTypeEnumValue` was renamed to `TypeEnumValue` in the `DialogNode` model
160+
* `NodeType` was renamed to `Type` in the `DialogNode` model
161+
* `ActionTypeEnumValue` was renamed to `TypeEnumValue` in the `DialogNodeAction` model
162+
* `ActionType` was renamed to `Type` in the `DialogNodeAction` model
163+
* `SEARCH_SKILL` constant was added to the `DialogNodeOutputGeneric` model
164+
* `QueryTypeEnumValue` constants were added to the `DialogNodeOutputGeneric` model
165+
* `QueryType` property was added to the `DialogNodeOutputGeneric` model
166+
* `Query` property was added to the `DialogNodeOutputGeneric` model
167+
* `Filter` property was added to the `DialogNodeOutputGeneric` model
168+
* `DiscoveryVersion` property was added to the `DialogNodeOutputGeneric` model
169+
* `Output` property type was converted from `Dictionary<string, object>` to `DialogSuggestionOutput` in the `DialogSuggestion` model
170+
* `LogMessage` model no longer has `additionalProperties`
171+
* `DialogRuntimeResponseGeneric` was renamed to `RuntimeResponseGeneric`
172+
* `RuntimeEntity` model no longer has `additionalProperties`
173+
* `RuntimeIntent` model no longer has `additionalProperties`
174+
* `ValueTypeEnumValue` was renamed to `TypeEnumValue` in the `Value` model
175+
* `ValueType` was renamed to `Type` in the `Value` model
176+
177+
##### Assistant v2
178+
179+
* `ActionTypeEnumValue` was renamed to `TypeEnumValue` in the `DialogNodeAction` model
180+
* `ActionType` was renamed to `Type` in the `DialogNodeAction` model
181+
* `DialogRuntimeResponseGeneric` was renamed to `RuntimeResponseGeneric`
182+
183+
##### Compare Comply v1
184+
185+
* `ConvertToHtml()` method does not require a `filename` parameter
186+
187+
##### Discovery v1
188+
189+
* `returnFields` was renamed to `_return` in the `Query()` method
190+
* `loggingOptOut` was renamed to `xWatsonLoggingOptOut` in the `Query()` method
191+
* `spellingSuggestions` was added to the `Query()` method
192+
* `collectionIds` is no longer a parameter of the `Query()` method
193+
* `returnFields` was renamed to `_return` in the `QueryNotices()` method
194+
* `loggingOptOut` was renamed to `xWatsonLoggingOptOut` in the `FederatedQuery()` method
195+
* `collectionIds` is now required in the `FederatedQuery()` method
196+
* `collectionIds` changed position in the `FederatedQuery()` method
197+
* `returnFields` was renamed to `_return` in the `FederatedQuery()` method
198+
* `returnFields` was renamed to `_return` in the `FederatedQueryNotices()` method
199+
* `EnrichmentName` was renamed to `_Enrichment` in the `Enrichment` model
200+
* `FieldTypeEnumValue` was renamed to `TypeEnumValue` in the `Field` model
201+
* `FieldType` was renamed to `Type` in the `Field` model
202+
* `FieldName` was renamed to `_Field` in the `Field` model
203+
* `TestConfigurationInEnvironment()` method was removed
204+
* `QueryEntities()` method was removed
205+
* `QueryRelations()` method was removed
206+
207+
##### Language Translator v3
208+
209+
* `defaultModels` was renamed to `_default` in the `ListModels()` method
210+
* `TranslationOutput` was renamed to `_Translation` in the `Translation` model
211+
212+
##### Natural Language Classifier v1
213+
214+
* `metadata` was renamed to `trainingMetadata` in the `CreateClassifier()` method
215+
216+
##### Speech to Text v1
217+
218+
* `strict` is no longer a parameter of the `TrainAcousticModel()` method
219+
* `FinalResults` was renamed to `Final` in the `SpeakerLabelsResult` model
220+
* `FinalResults` was renamed to `Final` in the `SpeechRecognitionResult` model
221+
222+
##### Visual Recognition v3
223+
224+
* `DetectFaces()` method was removed
225+
* `ClassName` was renamed to `_Class` in the `ClassResult` model
226+
* `ClassName` was renamed to `_Class` in the `ModelClass` model
227+
228+
##### Visual Recognition v4
229+
230+
* New service!

0 commit comments

Comments
 (0)