Skip to content

Commit 1db1103

Browse files
committed
docs: Update readme
1 parent 835bb99 commit 1db1103

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

README.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ You supply either an IAM service **API key** or an **access token**:
7272
void Example()
7373
{
7474
IamConfig iamConfig = new IamConfig(
75-
apikey: "<iam-apikey>"
75+
Apikey: "{iam-apikey}"
7676
);
77-
service = new AssistantService("<versionDate>", iamConfig);
78-
service.SetEndpoint("<service-endpoint>");
77+
service = new AssistantService("{versionDate}", iamConfig);
78+
service.SetEndpoint("{service-endpoint}");
7979
}
8080
```
8181

@@ -84,10 +84,10 @@ void Example()
8484
void Example()
8585
{
8686
IamConfig iamConfig = new IamConfig(
87-
userManagedAccessToken: "<iam-access-token>"
87+
UserManagedAccessToken: "{iam-access-token}"
8888
);
89-
service = new AssistantService("<versionDate>", iamConfig);
90-
service.SetEndpoint("<service-endpoint>");
89+
service = new AssistantService("{versionDate}", iamConfig);
90+
service.SetEndpoint("{service-endpoint}");
9191
}
9292
```
9393

@@ -96,11 +96,11 @@ void Example()
9696
void Example()
9797
{
9898
BasicAuthConfig basicAuthConfig = new BasicAuthConfig(
99-
username: "<username>",
100-
password: "<password>"
99+
Username: "{username}",
100+
Password: "{password}"
101101
);
102-
service = new AssistantService("<versionDate>", basicAuthConfig);
103-
service.SetEndpoint("<service-endpoint>");
102+
service = new AssistantService("{versionDate}", basicAuthConfig);
103+
service.SetEndpoint("{service-endpoint}");
104104
}
105105
```
106106

@@ -112,12 +112,13 @@ Like IAM, you can pass in credentials to let the SDK manage an access token for
112112
void Example()
113113
{
114114
Icp4dConfig icp4dConfig = new Icp4dConfig(
115-
username: "<username>",
116-
password: "<password>"
115+
Username: "{username}",
116+
Password: "{password}",
117+
Url: "https://{icp4d_cluster_host}{:port}"
117118
);
118-
AssistantService assistant = new AssistantService("<version-date>", icp4dConfig);
119-
service.SetEndpoint("<service-endpoint>");
120-
var results = assistant.Message("<workspace-id>", "<message-request>");
119+
AssistantService assistant = new AssistantService("{version-date}", icp4dConfig);
120+
service.SetEndpoint("{service-endpoint}");
121+
var results = assistant.Message("{workspace-id}", "{message-request}");
121122
}
122123
```
123124

@@ -126,11 +127,12 @@ void Example()
126127
void Example()
127128
{
128129
Icp4dConfig icp4dConfig = new Icp4dConfig(
129-
userManagedAccessToken: "<access-token>"
130+
UserManagedAccessToken: "{access-token}",
131+
Url: "https://{icp4d_cluster_host}{:port}"
130132
);
131-
AssistantService assistant = new AssistantService("<version-date>", icp4dConfig);
132-
service.SetEndpoint("<service-endpoint>");
133-
var results = assistant.Message("<workspace-id>", "<message-request>");
133+
AssistantService assistant = new AssistantService("{version-date}", icp4dConfig);
134+
service.SetEndpoint("{service-endpoint}");
135+
var results = assistant.Message("{workspace-id}", "{message-request}");
134136
}
135137
```
136138
Be sure to both [disable SSL verification](#self-signed-certificates) when authenticating and set the endpoint explicitly to the URL given in ICP.
@@ -162,27 +164,27 @@ If you're using more than one service at a time in your code and get two differe
162164
If you would like to configure the location/name of your credential file, you can set an environment variable called `IBM_CREDENTIALS_FILE`. **This will take precedence over the locations specified above.** Here's how you can do that:
163165

164166
```bash
165-
export IBM_CREDENTIALS_FILE="<path>"
167+
export IBM_CREDENTIALS_FILE="{path}"
166168
```
167169

168-
where `<path>` is something like `/home/user/Downloads/<file_name>.env`.
170+
where `{path}` is something like `/home/user/Downloads/{file_name}.env`.
169171

170172
#### Manually
171173

172174
If you'd prefer to set authentication values manually in your code, the SDK supports that as well. The way you'll do this depends on what type of credentials your service instance gives you.
173175

174176
## Custom Request Headers
175-
You can send custom request headers by adding them to the service using `.WithHeader(<key>, <value>)`.
177+
You can send custom request headers by adding them to the service using `.WithHeader({key}, {value})`.
176178
```cs
177179
void Example()
178180
{
179181
IamConfig iamConfig = new IamConfig(
180-
apikey: "<iam-apikey>"
182+
Apikey: "{iam-apikey}"
181183
);
182-
AssistantService assistant = new AssistantService("<version-date>", iamConfig);
183-
service.SetEndpoint("<service-endpoint>");
184+
AssistantService assistant = new AssistantService("{version-date}", iamConfig);
185+
service.SetEndpoint("{service-endpoint}");
184186
assistant.WithHeader("X-Watson-Metadata", "customer_id=some-assistant-customer-id");
185-
var results = assistant.Message("<workspace-id>", "<message-request>");
187+
var results = assistant.Message("{workspace-id}", "{message-request}");
186188
}
187189
```
188190

@@ -192,11 +194,11 @@ You can get the response headers, status code and the raw json response in the r
192194
void Example()
193195
{
194196
IamConfig iamConfig = new IamConfig(
195-
apikey: "<iam-apikey>"
197+
Apikey: "{iam-apikey}"
196198
);
197-
AssistantService assistant = new AssistantService("<version-date>", iamConfig);
198-
service.SetEndpoint("<service-endpoint>");
199-
var results = assistant.Message("<workspace-id>", "<message-request>");
199+
AssistantService assistant = new AssistantService("{version-date}", iamConfig);
200+
service.SetEndpoint("{service-endpoint}");
201+
var results = assistant.Message("{workspace-id}", "{message-request}");
200202

201203
var responseHeaders = results.Headers; // The response headers
202204
var responseJson = results.Response; // The raw response json
@@ -210,13 +212,14 @@ You can disable SSL verification on calls to Watson (only do this if you really
210212
void Example()
211213
{
212214
Icp4dConfig icp4dConfig = new Icp4dConfig(
213-
username: "<username>",
214-
password: "<password>",
215-
disableSslVerification: true
215+
Username: "{username}",
216+
Password: "{password}",
217+
Url: "https://{icp4d_cluster_host}{:port}",
218+
DisableSslVerification: true
216219
);
217-
AssistantService assistant = new AssistantService("<version-date>", icp4dConfig);
218-
service.SetEndpoint("<service-endpoint>");
219-
var results = assistant.Message("<workspace-id>", "<message-request>");
220+
AssistantService assistant = new AssistantService("{version-date}", icp4dConfig);
221+
service.SetEndpoint("{service-endpoint}");
222+
var results = assistant.Message("{workspace-id}", "{message-request}");
220223
}
221224
```
222225

@@ -234,7 +237,7 @@ Find more open source projects on the [IBM Github Page][ibm-github].
234237
This library is licensed under Apache 2.0. Full license text is available in [LICENSE](LICENSE).
235238

236239
## Contributing
237-
See [CONTRIBUTING.md](.github/CONTRIBUTING.md).<TODO revise coding standard>
240+
See [CONTRIBUTING.md](.github/CONTRIBUTING.md).
238241

239242
## Featured projects
240243
We'd love to highlight cool open-source projects that use this SDK! If you'd like to get your project added to the list, feel free to make an issue linking us to it.
@@ -255,10 +258,7 @@ We'd love to highlight cool open-source projects that use this SDK! If you'd lik
255258
[tone_analyzer]: https://www.ibm.com/watson/developercloud/tone-analyzer/api/v3/
256259
[visual_recognition]: https://www.ibm.com/watson/developercloud/visual-recognition/api/v3/
257260

258-
[document_conversion]: https://www.ibm.com/watson/developercloud/document-conversion/api/v1/
259-
[retrieve_and_rank]: https://www.ibm.com/watson/developercloud/retrieve-and-rank/api/v1/
260261
[natural_language_classifier]: https://www.ibm.com/watson/developercloud/natural-language-classifier/api/v1/
261-
[tradeoff_analytics]: https://www.ibm.com/watson/developercloud/tradeoff-analytics/api/v1/
262262

263263
[dotnet-core-download]: https://www.microsoft.com/net/download/core
264264
[visual-studio-download]: https://www.visualstudio.com/vs/community/

0 commit comments

Comments
 (0)