watsonx Developer Hub
curl -X POST \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
--data-raw "{
\"input\": \"How far is Paris from Bangalore?\",
\"model_id\": \"ibm/granite-13b-chat-v2\",
\"project_id\": \"{project_id}\"
}" \
"https://{region}/ml/v1/text/generation?version=2024-05-31"
const { WatsonXAI } = require('@ibm-cloud/watsonx-ai');
const watsonxAIService = WatsonXAI.newInstance();
const textGeneration = watsonxAIService.generateText( {
input: 'How far is Paris from Bangalore?',
modelId: 'ibm/granite-13b-chat-v2',
projectId: '{project_id}
);
from ibm_watsonx_ai.foundation_models import ModelInference
model = ModelInference(
model_id="ibm/granite-13b-chat-v2",
project_id="{project_id}"
)
prompt = 'How far is Paris from Bangalore?'
Start building
Support your next project with some of our most commonly used capabilities.