File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -13,3 +13,4 @@ Articles:
1313Snippets:
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
Original file line number Diff line number Diff line change 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
77This provides a simple example of calling an LLM from a GraphQL endpoint.
88
99An 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+ ```
1518STEPZEN_IBM_IAM_APIKEY=
1619STEPZEN_WATSONXAI_URL=
1720STEPZEN_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
1929Then you can use ` stepzen request ` and the provided operation to ask simple questions:
2030
Original file line number Diff line number Diff 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"""
8383type 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"""
9393type WXAI_GenerationResult {
9494 generated_text : String
You can’t perform that action at this time.
0 commit comments