Unleashing the Power of Gen AI: A Beginner's Guide

Published On Mon Aug 12 2024
Unleashing the Power of Gen AI: A Beginner's Guide

A Beginner's Learning Venture with Gen AI to Creat... - SAP ...

There is no doubt that the term “Gen AI” (short for Generative AI) has grabbed everyone’s attention. Because of its potential applications across industries and disciplines, everybody wants to test the technology and identify its use cases. Chat GPT and Google Gemini have now become personal assistants for professionals and non-professions alike when it comes to producing drafts, generating ideas, or exploring debugging solutions. It has become a buzzing topic for discussion in all professional spheres, and now a personal goal for individuals to learn more about it before their next review 😉 Either way, it’s interesting to know how GenAI works.

Towards this end, I tried out our own SAP AI Core to get some hands-on experience of this technology by creating a chat assistant.

Purpose:

To use ‘generative-ai-hub-sdk’ to access the ‘gpt-35-turbo’ LLM model from SAP's Generative AI Hub in AI Core Required Pre-requisite Steps:

Picture1.png

Once the desired LLM is deployed, it would help the bot to understand the text-based context. LLM is built using deep learning techniques, which is what enables it to capture complex patterns in language based on the specification of various parameters. Next, I defined the chat interface using the LangChain PromptTemplates, and tried langchain.memory ConversationBufferWindowMemory to store the chat history.

Picture2.png Picture3.png

The ChatPromptTemplate displayed above helps structure and format prompts to design the interface for multi turn interaction. ‘temperature’, ‘max_tokens’, and ‘top_p’ are parameters in a model that determine the behavior of the chat bot and help fine tune its output. And here’s the output:

Picture4.png

You are only a few steps away from creating your own chat bot and playing around with its functionalities. This may well be the small start for those who are yet to venture into the exciting applications of generative AI.

Useful References:

Learning how to use the SAP AI Core service on SAP Business Techn

Picture5.png

Prompt LLMs in the generative AI hub in SAP AI Core & Launchpad | SAP Tutorials