Skip to content

Commit d59bffc

Browse files
committed
chore; cleanup
1 parent 195feba commit d59bffc

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

ai/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ Articles:
1313
Snippets:
1414

1515
- [Prescribed tools](../executable/prescribed/) - Demonstrates creation of MCP tools from persisted GraphQL operations.
16+
- [watsonx.AI generation](watsonxai-generation/) - Demonstrates invoking an LLM through watsonx.AI

ai/watsonxai-generation/README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
1-
# Watsonx.AI generation.
1+
# watsonx.ai generation.
22

33
## Overview
44

5-
Creates a field `Query.wxai_generation` that invokes a Watsonx.AI generation endpoint to infer the next text from an input.
5+
Creates a field `Query.wxai_generation` that invokes a watsonx.ai generation endpoint to infer the next text from an input.
66

77
This provides a simple example of calling an LLM from a GraphQL endpoint.
88

99
An IBM Cloud IAM token is used for authorization, taken from the [ibm-iam snippet](../../rest/ibm-iam/).
1010

1111
## Try it out
1212

13-
Deploy the schema with this values set in `.env` for your Watsonx.AI project.
13+
### Deploying
1414

15+
Deploy the schema with this values set in `.env` for your watsonx.ai project.
16+
17+
```
1518
STEPZEN_IBM_IAM_APIKEY=
1619
STEPZEN_WATSONXAI_URL=
1720
STEPZEN_WATSONXAI_PROJECTID=
21+
```
22+
23+
These can be obtained from the watsonx dashboard:
24+
25+
<img width="362" height="452" alt="image" src="https://github.com/user-attachments/assets/1eaa1671-2e2c-4a34-8ae7-1fd42ce9887e" />
26+
27+
### Sample request
1828

1929
Then you can use `stepzen request` and the provided operation to ask simple questions:
2030

ai/watsonxai-generation/watsonx-ai.graphql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ input WXAI_GenerationParameters {
7878
}
7979

8080
"""
81-
Response of IBM Generative AI watsonx.ai `generation` endpoint
81+
Response of IBM watsonx.ai `generation` endpoint
8282
"""
8383
type WXAI_GenerationResponse {
8484
created_at: DateTime
@@ -88,7 +88,7 @@ type WXAI_GenerationResponse {
8888
}
8989

9090
"""
91-
A result in the response of IBM Generative AI watsonx.ai `generation` endpoint
91+
A result in the response of IBM watsonx.ai `generation` endpoint
9292
"""
9393
type WXAI_GenerationResult {
9494
generated_text: String

0 commit comments

Comments
 (0)