Overview
While Conversational AI serves its purpose, the true value and optimization lie in LLM Agents.
What are LLM Agents?
“LLM Agent” stands for “Large Language Model Agent.” It refers to an advanced AI system built on large language models, such as OpenAI’s GPT (Generative Pre-trained Transformer) models or similar architectures. These models are trained on vast amounts of text data and have a deep understanding of natural language. LLM Agents are capable of understanding and generating human-like text, making them highly effective for tasks such as natural language understanding, text generation, and conversation management.
In practical terms, an LLM Agent can be used for a variety of applications, including chatbots, virtual assistants, content generation, language translation, and more. They excel at processing and generating text in a way that closely mimics human language patterns, allowing for more natural and engaging interactions with users.
Why Java
Given the prevalence of Java in enterprise applications, bridging the gap between AI and Java for function calling becomes essential. Tools4AI serves as a Java-based LLM (Large Language Model) Agent platform, facilitating seamless integration of AI capabilities into Java applications.
Example
In this article I will demonstrate how to build a AI HUB with function calling which can convert prompt into actions
Fully working product is deployed here
The enterprise AI Hub, a sophisticated Large Language Model (LLM) Agent or Large Action Model Agent, functions as a central intelligence system. It is meticulously integrated with an array of enterprise applications, including a pet store, bookstore, service management system, bug tracking system, and employee management system. Crafted entirely in Java and utilizing OpenAI’s capabilities, this hub stands as a testament to the versatility and power of modern AI technologies in enterprise applications.
The configurations are present here
As you can see from configuration the hub is connected to Petstore, Bookstore, and a bugs and ticketing system , you can visit the respective swagger url to look at the apis they expose via REST Calls
{
"endpoints" : [
{
"swaggerurl": "https://fakerestapi.azurewebsites.net/swagger/v1/swagger.json",
"group": "Books Author Activity",
"description": "This is for all the actions related books , Authors, photos and users trying to read books and view photos",
"baseurl": "https://fakerestapi.azurewebsites.net/",
"id": "fakerestapi"
},
{
"swaggerurl": "https://petstore3.swagger.io/api/v3/openapi.json",
"baseurl": "https://petstore3.swagger.io/",
"group": "Petstore API",
"description": "This is for all the actions related to pets",
"id": "petstore"
} ,
{
"swaggerurl": "https://vishalmysore-instaservice.hf.space/v3/api-docs",
"baseurl": "https://vishalmysore-instaservice.hf.space/",
"group": "Enterprise Support and Tickeing System",
"description": "This action is to create tickets track bugs across the enterprise",
"id": "InstaService"
}
]
}
The central hub can be tested using simple prompts - test it using this url
/getAllGroupNames
Provides the list of all the enterprise systems connected to this hub, (these are your ticketing system, employee management system , HR system) basically any system exposing REST API
[
{
"groupName": "default",
"groupDescription": "group for all the tasks"
},
{
"groupName": "Books Author Activity",
"groupDescription": "This is for all the actions related books , Authors, photos and users trying to read books and view photos"
},
{
"groupName": "Petstore API",
"groupDescription": "This is for all the actions related to pets"
},
{
"groupName": "Enterprise Support and Tickeing System",
"groupDescription": "This action is to create tickets track bugs across the enterprise"
}
]
/getAllActionsForGroup
This REST api provides all the actions associated with that application if you trigger with groupName = Petstore API , you get this result
updatePet,addPet,findPetsByStatus,findPetsByTags,getPetById,updatePetWithForm,deletePet,uploadFile,getInventory,placeOrder,getOrderById,deleteOrder,createUser,createUsersWithListInput,loginUser,logoutUser,getUserByName,updateUser,deleteUser
/actionOpenAI
Any action can be triggered by simple English prompts
for example
if you provide a prompt “create a ticket for me with number 1 and issue is compture not working” it will automatically create a ticket on InstaService you can view the logs here
Try out with different prompts and validate that corresponding actions have been triggered
- My Customer name is Vishal , his computer needs repair - will trigger this action
- Can you compare Honda City to Toyota Corolla - this prompt will trigger Car Compare action
- Can i Go out without Jacket in Toronto today - This prompt will trigger weather service action
- what would vishal want to eat today? - this prompt will trigger this action