Skip to content

Instantly share code, notes, and snippets.

View nadheesh's full-sized avatar

Nadheesh Jihan, nadheesh@wso2.com nadheesh

  • WSO2 Lanka (Pvt) Ltd
View GitHub Profile
@nadheesh
nadheesh / agent-sample-1.bal
Last active August 20, 2023 07:34
Ballerina functions and API calls as tools.
// Copyright (c) 2023 WSO2 LLC (http://www.wso2.org) All Rights Reserved.
// WSO2 Inc. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing,
@nadheesh
nadheesh / main.bal
Last active May 17, 2023 05:17 — forked from praneesha/main.bal
import ballerina/http;
import ballerinax/openai.text;
import ballerina/log;
// Define a configurable variable for the OpenAI access key.
configurable string openAIToken = ?;
// Create the HTTP service configuration.
@http:ServiceConfig {
cors: {