Source code and Documentation for my ADUG Symposium Talk presented on the 28th of April 2023. I have since added to and enhanced the code to further demonstrate capabilities of AI.
The goal of this project is to enable delphi users to be able to use AI technology in their applications. There are many different types of AI and thousands of different models. This project is working on creating generalized interfaces to the different types of AI models and make them easily accessible.
Artificial intelligence (AI) is an interdisciplinary field that combines computer science, mathematics, and cognitive psychology to create intelligent systems capable of performing complex tasks. Its rapid advancements have led to a wide array of applications demonstrating AI's versatility.
Language translation is one such application, where AI-powered tools efficiently translate between languages, simplifying tasks like translating software programs for global audiences. AI also excels in human-like conversations, with interactive applications that understand and respond to human language naturally. Voice recognition and real-time speech-to-text allow conversion and seamless voice-based interactions, making AI-driven applications more accessible and user-friendly.
In creative and artistic domains, AI can generate images based on textual descriptions, showcasing its capacity to understand and produce visual content. AI's computer vision capabilities enable it to accurately recognize faces and other objects in photographs and documents, illustrating its potential in visual recognition tasks and diverse applications like security and automation.
AI's ability to analyze and process data, and generate comprehensive reports highlights its value in various domains. Furthermore, AI-powered tools can transcribe audio files into written text, making transcription tasks more efficient and accurate.
The example programs below is an attempt to demonstrate the capabilities available to Delphi programmers today. I have worked on creating generic API's so that different providers can be swapped in or out to:
- experiment
- follow the current leading AI model
- make it easy to change based on price
- avoid vendor lockin
- or for any other reason.
- ChatGPTAction
- Simple Server app that can be added to a ChatGPT GPT action to allow your computer to write delphi code. See AI Generated Delphi for some example programs created with ChatGPTAction.
- EmbeddingsDemo
- Simple demo showing how Embeddings work
- Translate
- translates between languages using the various cloud API's.
- Simplify translating Delphi programs when using Delphi's built-in multi language resource support.
- DelphiChatGPT
- FaceDetection
- Weather
- TranscribeAudio
- Upload a audio file and have it translated via a cloud speech to text api.
- VoiceRecognition
- Image generation
- generate an image using text that you provide using OpenAI's DALLE-2 and DALLE-3 API.
- ProcessInvoice
- from a pdf invoice extract out the important details and format as a machine readable JSON string
- TestAPIs
- A project to test out the different API's and the functionality of the API's
Create an issue and I will respond to it.
- Google - Text to Speech, LLM, Translate
- Microsoft Azure - Text to Speech, GPT, Translate
- Amazon - Text to Speech, Translate
- Anthropic claude-3-opus, claude-3-sonnet and claude-3-haiku, supporting one of largest context windows currently available (200k tokens)
- X.AI grok-beta LLM
- Replicate access a wide range of models
- Huggingface access a wide range of models
- ElevenLabs Text to Speech and Voice Cloning
- OpenAI Text to Speech, Whisper Voice Recognition, DALLE-2, DALLE-3 Image Generation, GPT4 LLM
- AssemblyAI Voice Recognition
- DeepGram Voice Recognition
- Rev.AI Voice Recognition
- Conqui-ai Run a variaty of text to speech models locally from a docker container
- CodeProject-Ai Local Face Detection.
- Each of the cloud API's need to have been setup in their respective developer consoles. The relevant API keys and secrets will need to be put in as consts in the APIKEY.INC file.
- A file in /libs/APIKEY.INC.EXAMPLE shows all the available keys to enter. If you're not using a particular provider you don't need a key for it.
- Please feel free to raise issues about any questions you have about the code. I know there is a lot to this project and lots to setup, so I would like to improve the documentation to make it easy for everyone to use all the parts of this project.
- Using Embeddings to search large datasets
- Using Python4Delphi to be able to call various Python AI libraries from Delphi.
-
whisper.cpp Voice Recognition
-
RDOpenAI Delphi implementation of ChatGPT - an event based component
-
ChatGPT OpenAI ChatGPT
-
DelphiOpenAI a Delphi Library for OpenAI
-
ChatGPTPluginForLazarus An OpenAI (ChatGPT) plug-in for Lazarus IDE.
-
ChatGPT a Firemonkey ChatGPT interface written in Delphi.
-
AI-Playground-DesktopClient A Firemonkey Language model playground to access languages models like StableLM, ChatGPT, and more.
-
AI-Code-Translator Use GPT to translate between programming languages
-
TOpenALPR Open Source Number Plate recognition
-
PgVector PgVector allows storing and querying of Vectors/Embeddings in an SQL database
-
CommonVoice Public dataset of recordings for Voice Recognition
- ICS 9.0 or from the GetIt package manager built into Delphi. - For Voice recognition
- landgraf-dev/aws-sdk-delphi AWS SDK
- DelphiMVCFramework for ChatGPTAction
- https://github.com/PKGeorgiev/Delphi-JsonToDelphiClass
- Fiddler
- XML Data Binder in Delphi