from onprem import LLM
from onprem.pipelines import Agent
= LLM('openai/gpt-4o-mini', mute_stream=True)
llm = Agent(llm) agent
Agent-Based Task Execution
Setup the LLM and Agent
First, we’ll set up our LLM instance that will power our agent. For agent-based tasks, models with strong reasoning abilities work best. We’ll use GPT-4o-mini for these examples, but you could also use other local or cloud models like Llama-3.1-8B, Mixtral, or Claude.
Giving the Agent Access to Tools
Next, we will give the agent access tools when executing a given task. Examples of tool types include the ability to do the following: 1. perform a web search 2. visit a web page 3. search your documents stored within a vector store (e.g., agentic RAG) 4. accessing Python interpreter 5. accessing an MCP server 6. executing a custom function that you provide (i.e., implementing your own custom tools)
Example: Using a Custom Tool with Web Search
In this example, we will give the agent access to web search and a function that returns today’s date to find historical events for the current day.
def today() -> str:
"""
Gets the current date and time
Returns:
current date and time
"""
from datetime import datetime
return datetime.today().isoformat()
agent.add_function_tool(today)
agent.add_websearch_tool()for tup in agent.tools.items():
print(tup)
('today', <smolagents.tools.tool.<locals>.SimpleTool object>)
('websearch', <smolagents.default_tools.WebSearchTool object>)
= agent.run("Any famous events that happened on today's date?") answer
╭──────────────────────────────────────────────────── New run ────────────────────────────────────────────────────╮ │ │ │ Any famous events that happened on today's date? │ │ │ ╰─ AgentModel - None ─────────────────────────────────────────────────────────────────────────────────────────────╯
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ Calling tool: 'today' with arguments: {} │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Observations: 2025-06-24T14:39:35.557320
[Step 1: Duration 1.96 seconds]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 2 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ Calling tool: 'web_search' with arguments: {'query': 'famous events on June 24th'} │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Observations: ## Search Results |Historical Events on June 24 - On This Day](https://www.onthisday.com/events/june/24) June in History. How the Qwerty Keyboard was Born June 23, 1868; The Fatal Dance Manias of Medieval Europe June 24, 1374; Custer's Last Stand June 25, 1876; Kennedy's Clarion Call for Freedom June 26, 1963 |June 24th: All Facts & Events That Happened Today In History](https://facts.net/history/historical-events/june-24th-all-facts-events-that-happened-today-in-history/) On June 24th , significant events like the start of the War of 1812 and the birth of famous personalities like Lionel Messi and Mindy Kaling shaped history. June 24th witnessed the birth of legends, scientific breakthroughs, and cultural milestones, making it a day filled with diverse and impactful historical events . |On This Day - What Happened on June 24 | Britannica](https://www.britannica.com/on-this-day/June-24) On This Day In History - June 24: anniversaries, birthdays, major events , and time capsules. This day's facts in the arts, politics, and sciences. |What Happened on June 24 - HISTORY](https://www.history.com/this-day-in-history/June-24) On June 24, 1973, an arson fire at the UpStairs Lounge, a popular gathering spot for New Orleans' LGBT community in the French Quarter, results in 32 deaths and at least 15 injuries. |June 24: Facts & Historical Events On This Day - The Fact Site](https://www.thefactsite.com/day/june-24/) June 24th is the day we officially celebrate Fairy Day and Pralines Day. Today marks day 175 of the year, and we have 190 days remaining until the end of the year. You're about to unearth some incredible historical events that all happened throughout history on June 24, including one of the longest sports matches of all time and some major ... |This Day in History on June 24th - History and Headlines](https://www.historyandheadlines.com/this-day-in-history-on-june-24th/) This article presents a chronological list of notable events that happened on June 24th . For each date below, please click on the date to be taken to an article covering that date's event . Digging Deeper. On June 24, 109 AD, Roman Emperor Trajan opened the aqueduct known as Aqua Traiana, bringing water to Rome from Lake Bracciano 25 miles away. |Events on June 24 - Key Moments Throughout History - Take Me Back To](https://takemeback.to/events/date/June/24) Historical Events on June 24: Significant Moments in History. Throughout history, certain dates stand out for the remarkable events that unfolded on them. From turning points in politics to cultural breakthroughs, these days often carry significance that echoes through time. Explore the most important events that occurred on June 24, revealing ... |June 24 Events in History - Have Fun With History](https://www.havefunwithhistory.com/june-24/) This article explores significant historical events that occurred on June 24th , tracing pivotal moments from medieval battles to modern achievements. Starting with the Battle of Bannockburn in 1314, which shaped Scottish independence, the narrative moves through milestones in exploration, arts, and technology, concluding with a record-breaking Wimbledon match in 2010. Each entry examines the ... |Historical Events on June 24, Facts & Special Events On This Day ...](https://www.calendarz.com/on-this-day/events/june/24) Historical events for June 24. See what famous , interesting and special events & facts happened throughout history on June 24 related to American Revolutionary War, Serbia, World War II, Apartheid, Thailand, and many more. |June 24 Holidays (2025/2026), Historical Events, Famous Birthdays](https://www.holidayscalendar.com/day/june-24/) Historical Events on June 24. 1340: King Edward III and his fleet almost completely destroys the French fleet at the Battle of Sluys during the 100 Years War. 1374: In Aachen, Germany, cases of St. John's Dance mysteriously erupt in the streets of the city. 1497: At Newfoundland, John Cabot lands. It's the first European landing at the area since the Vikings landed there previously.
[Step 2: Duration 2.75 seconds]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 3 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ Calling tool: 'final_answer' with arguments: {'answer': "Several historical events occurred on June 24th, │ │ including:\n1. In 1374, cases of St. John's Dance mysteriously erupted in Aachen, Germany.\n2. In 1497, John │ │ Cabot landed in Newfoundland, marking the first European landing at the site since the Vikings.\n3. In 1340, │ │ King Edward III's fleet defeated the French fleet at the Battle of Sluys during the 100 Years War.\n4. On June │ │ 24, 1973, an arson fire at the UpStairs Lounge in New Orleans' LGBT community resulted in 32 deaths."} │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Final answer: Several historical events occurred on June 24th, including: 1. In 1374, cases of St. John's Dance mysteriously erupted in Aachen, Germany. 2. In 1497, John Cabot landed in Newfoundland, marking the first European landing at the site since the Vikings. 3. In 1340, King Edward III's fleet defeated the French fleet at the Battle of Sluys during the 100 Years War. 4. On June 24, 1973, an arson fire at the UpStairs Lounge in New Orleans' LGBT community resulted in 32 deaths.
[Step 3: Duration 3.53 seconds]
from IPython.display import display, Markdown
display(Markdown(answer))
Several historical events occurred on June 24th, including: 1. In 1374, cases of St. John’s Dance mysteriously erupted in Aachen, Germany. 2. In 1497, John Cabot landed in Newfoundland, marking the first European landing at the site since the Vikings. 3. In 1340, King Edward III’s fleet defeated the French fleet at the Battle of Sluys during the 100 Years War. 4. On June 24, 1973, an arson fire at the UpStairs Lounge in New Orleans’ LGBT community resulted in 32 deaths.
Example: Web Information Extraction
In the next example, we will use the Web View tool to extract information from a Web page.
= Agent(llm)
agent
agent.add_webview_tool()= agent.run("What is the highest level of education of the person listed on this page: https://arun.maiya.net?") answer
╭──────────────────────────────────────────────────── New run ────────────────────────────────────────────────────╮ │ │ │ What is the highest level of education of the person listed on this page: https://arun.maiya.net? │ │ │ ╰─ AgentModel - None ─────────────────────────────────────────────────────────────────────────────────────────────╯
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ Calling tool: 'visit_webpage' with arguments: {'url': 'https://arun.maiya.net'} │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Observations: Arun S. Maiya Arun S. Maiya arun |at] maiya |dot] net |CV](asmcv.pdf) | |LinkedIn](https://www.linkedin.com/in/arun-maiya/) | |GitHub](https://github.com/amaiya) !|](asmpic.jpg) Basics ====== I am a computer scientist at the |Institute for Defense Analyses (IDA)](http://www.ida.org), a federally-funded |think tank](http://en.wikipedia.org/wiki/List_of_federally_funded_research_and_development_centers) in the Washington D.C. metro area. My research broadly focuses on the study of computational methods to *extract meaning from raw data* and includes the areas of natural language processing, machine learning, data mining, computer vision, and network science (e.g., social network analysis). I like building tools to make machine learning easier to apply in new ways and new areas. Through my work, I have contributed to national-level strategic-planning activities and R&D roadmaps. I completed a Ph.D. in Computer Science at the |Laboratory for Computational Population Biology](http://compbio.cs.uic.edu/), which is within the |Department of Computer Science](http://www.cs.uic.edu/) at the |University of Illinois at Chicago (UIC)](http://www.uic.edu/). My CV is |here](http://arun.maiya.net/asmcv.pdf). Software ======== * **|ktrain](https://github.com/amaiya/ktrain)** is a Python library that makes deep learning and AI more accessible and easier to apply. With support for many different data types including text, images, and graphs, ktrain has been used for a wide range of use cases in industry, government, and academia. Examples include analyses for the U.S. Economic Census, financial crime analytics at Big 4 accounting firms, intelligence analyses, and |CoronaCentral.ai](https://coronacentral.ai), a machine-learning-enhanced search engine for coronavirus publications at Stanford University. * **|CausalNLP](https://github.com/amaiya/causalnlp)** is a practical toolkit for causal inference with text as treatment, outcome, or "controlled-for" variable. * **|IDATA](https://arxiv.org/abs/1308.2359)** is a suite of software capabilities designed to facilitate search, exploration, and analyses of very large document sets using state-of-the-art machine learning, NLP, and information retrieval. It has been used for a variety of different application in the |DoD](https://www.defense.gov) including cyber damage assessments, biosurveillance, and policy analyses. * **|OnPrem.LLM](https://github.com/amaiya/onprem)** is a simple Python package for generative AI that makes it easier to run large language models (LLMs) on your own machine using non-public data. Publications ============ |**ktrain: A Low-Code Library for Augmented Machine Learning**](https://www.jmlr.org/papers/volume23/21-1124/21-1124.pdf) A.S. Maiya *Journal of Machine Learning Research (JMLR).* May 2022. |**CausalNLP: A Practical Toolkit for Causal Inference with Text**](https://arxiv.org/abs/2106.08043) A.S. Maiya *arXiv preprint arXiv:2106.08043 .* Jun 2021. |arXiv only] |**A Framework for Comparing Groups of Documents**](https://arxiv.org/abs/1508.05902) A.S. Maiya *Proc. 2015 Conference on Empirical Methods in Natural Language Processing (EMNLP '15).* Lisbon, Portugal. Sep 2015. |**Mining Measured Information from Text**](https://arxiv.org/abs/1505.01072) A.S. Maiya, D. Visser, and A. Wan *Proc. 38th Annual ACM SIGIR Conference (SIGIR '15).* Santiago, Chile. Aug 2015. |**Topic Similarity Networks: Visual Analytics for Large Document Sets**](https://arxiv.org/abs/1409.7591) A.S. Maiya and R.M. Rolfe *Proc. 2014 IEEE International Conference on Big Data (IEEE BigData '14).* Washington, D.C., Oct 2014. |**Exploratory Analysis of Highly Heterogeneous Document Collections**](https://arxiv.org/abs/1308.2359) A.S. Maiya, J.P. Thompson, F. Loaiza-Lemos, and R.M. Rolfe *Proc. 19th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD '13).* Chicago, IL, Aug 2013. |**Expansion and Decentralized Search in Complex Networks**](http://link.springer.com/article/10.1007/s10115-012-0596-4) A.S. Maiya and T.Y. Berger-Wolf *Journal of Knowledge and Information Systems.* First published online January 2013. |**Supervised Learning in the Wild: Text Classification for Critical Technologies**](https://ieeexplore.ieee.org/document/6415660) A.S. Maiya, F. Loaiza-Lemos, and R.M. Rolfe *Proc. IEEE Military Communications Conference (MILCOM '12).* Orlando, FL, Oct 2012. |**Benefits of Bias: Towards Better Characterization of Network Sampling**](https://arxiv.org/abs/1109.3911) A.S. Maiya and T.Y. Berger-Wolf *Proc. 17th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD '11).* San Diego, CA, Aug 2011. |**Aggression, Grooming, and Group-level Cooperation in White-faced Capuchins: Insights from Social Networks**](http://onlinelibrary.wiley.com/doi/10.1002/ajp.20959/abstract) M.C. Crofoot, D.I. Rubenstein, A.S. Maiya, and T.Y. Berger-Wolf *American Journal of Primatology.* First published online May 2011. |**Sampling and Inference in Complex Networks**](https://dl.acm.org/doi/abs/10.5555/2395432) A.S. Maiya *Ph.D. Dissertation, University of Illinois at Chicago (UIC).* Chicago, IL, Apr 2011. |**Expansion and Search in Networks**](https://arxiv.org/abs/1009.4383) A.S. Maiya and T.Y. Berger-Wolf *Proc. 19th ACM Intl. Conference on Information and Knowledge Management (CIKM '10).* Toronto, Canada, Oct 2010. |**Online Sampling of High Centrality Individuals in Social Networks**](https://link.springer.com/chapter/10.1007/978-3-642-13657-3_12) A.S. Maiya and T.Y. Berger-Wolf *Proc. 14th Pacific-Asia Conference on Knowledge Discovery and Data Mining (PAKDD '10).* Hyderabad, India, Jun 2010. |**Sampling Community Structure**](https://dl.acm.org/doi/10.1145/1772690.1772762) A.S. Maiya and T.Y. Berger-Wolf *Proc. 19th ACM Intl. Conference on the World Wide Web (WWW '10).* Raleigh, NC, Apr 2010. |**Inferring the Maximum Likelihood Hierarchy in Social Networks**](https://ieeexplore.ieee.org/document/5284124) A.S. Maiya and T.Y. Berger-Wolf *Proc. 12th IEEE Intl. Conference on Computational Science and Engineering (CSE '09).* Vancouver, Canada, Aug 2009. |**The Impact of Structural Changes on Predictions of Diffusion in Networks**](https://www.computer.org/csdl/proceedings-article/icdmw/2008/3503a939/12OmNBU1jIK) M. Lahiri, A.S. Maiya, R. Sulo, Habiba and T.Y. Berger-Wolf *ICDM '08 Workshop on Analysis of Dynamic Networks*. Pisa, Italy, Dec 2008. Honors and Awards ================= **Goodpaster Award for Excellence in Research**, Institute for Defense Analyses, 2021 ||News Release](https://www.ida.org/research-and-publications/publications/all/a/ar/arun-maiya-receives-2021-goodpaster-aw ard-for-excellence-in-research)] > *This prize is named for Gen. Andrew J. Goodpaster (USA, retired) and is awarded to an individual demonstrating "research excellence, exceptional analytic achievement and intellectual leadership."* **Welch Award for Best External Research**, Institute for Defense Analyses, 2016 > *Named in honor of General Larry D. Welch (USAF, ret.), this award "honors individuals whose external research publications exemplify General Welch's high standards of analytic excellence and relevance."* **AFEI Award for Excellence in Enterprise Information**, NDIA (formerly Association for Enterprise Information), 2015 > *This award is to "recognize and reward the contributions and achievements of project teams that exemplify excellence in achieving integrated enterprises. Winning teams are models of the best applications of technology and leadership to improve enterprise performance."* <script
[Step 1: Duration 1.50 seconds]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 2 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ Calling tool: 'final_answer' with arguments: {'answer': 'Ph.D. in Computer Science'} │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Final answer: Ph.D. in Computer Science
[Step 2: Duration 1.43 seconds]
print(answer)
Ph.D. in Computer Science
Example: Agentic RAG
You can also give the agent access to a vector store containing our documents. In this example, we will ingest a document about Generative AI into a vector store and provide the store to the agent as a tool.
from onprem.ingest.stores import DenseStore
= DenseStore('/tmp/myvectordb')
store 'tests/sample_data/docx_example/') store.ingest(
Creating new vectorstore at /tmp/myvectordb
Loading documents from tests/sample_data/docx_example/
Loading new documents: 100%|██████████████████████| 1/1 [00:04<00:00, 4.05s/it]
Processing and chunking 1 new documents: 100%|█████████████████████████████████████| 1/1 [00:00<00:00, 2184.53it/s]
Split into 17 chunks of text (max. 500 chars each for text; max. 2000 chars for tables)
Creating embeddings. May take some minutes...
100%|████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 2.67it/s]
Ingestion complete! You can now query your documents using the LLM.ask or LLM.chat methods
So far, we have been using the default tool-calling agent, which relies on the LLM to generate precise JSON structures that specify tool names and arguments required to complete a task.
By constrast, the code-agent generates and runs code to solve a task. We will use the code-agent in this final example.
= Agent(llm, agent_type='code')
agent ='genai_search',
agent.add_vectorstore_tool(name='Searches a database of information on generative AI.',
description=store)
store
= agent.run("Summarize some generative AI use cases in Markdown format. You may need to run at least three queries of the database.") answer
╭──────────────────────────────────────────────────── New run ────────────────────────────────────────────────────╮ │ │ │ Summarize some generative AI use cases in Markdown format. You may need to run at least three queries of the │ │ database. │ │ │ ╰─ AgentModel - None ─────────────────────────────────────────────────────────────────────────────────────────────╯
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
─ Executing parsed code: ──────────────────────────────────────────────────────────────────────────────────────── use_cases_general = genai_search(query="generative AI use cases") print(use_cases_general) ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Execution logs:
[{'id': '901846fb-fc97-42ef-810a-cedc8abfbcb8', 'score': 0.6182159185409546, 'text': '3. What is generative
AI?\n\nEven though AI is not new, you have probably been hearing a lot about easy-to-use, publicly available
Generative AI tools like ChatGPT and Google Gemini.\u202f \n\nBut what is generative AI?\u202f\u202f \n\nIt is a
type of AI technology that automatically generates (or creates) content in response to prompts given to it by
users.\u202f \n\nThese tools can generate text, images, music, video, code and other formats.'}, {'id':
'0b660b75-3bf3-47ab-a4bb-0f52039ec442', 'score': 0.5850328207015991, 'text': 'An introduction to generative
AI\n\n1. Introduction\n\nThis activity will give a brief overview of what Generative AI is and how it is being
used.\n\nUsing this tutorial\n\nUse the back and next buttons at the bottom right of the screen to navigate through
the tutorial. Alternatively, use the contents button to jump to a specific page.\n\nYou will need to allow
approximately\xa05\xa0minutes\xa0to complete the tutorial.\n\nLearning outcomes\n\nAfter completing this tutorial
you will be able to:'}, {'id': '57831af5-b767-4565-ba01-8845d8e6b261', 'score': 0.568540632724762, 'text':
'Question 5 Feedback for Option 3\n\nTrue. Generative AI tools rely on pattern recognition and do not truly
understand the content, which can lead to plausible but misleading or incorrect outputs.\n\nQuestion 5 Feedback for
Option 4\n\nFalse. Each response is unique; generative AI tools do not provide the same response every
time.\n\nBeing digital Copyright © 2024 The Open University'}, {'id': '3ab09f45-f5d2-468e-ae8e-710c116f51b7',
'score': 0.5618582367897034, 'text': 'Recognise generative AI in daily life: Identify common generative AI
applications like chatbots, facial recognition, streaming services, and digital assistants.\n\nUnderstand
generative AI: Explain generative AI and its ability to create diverse content such as text, images, music, video,
and code.\n\nDescribe LLMs: Understand how\xa0Large Language Models (LLMs) work.\n\n2. Examples of AI in everyday
life'}, {'id': 'ec272b15-9ff9-448b-a39b-3b89f0d6f524', 'score': 0.5566920042037964, 'text': '5. Quiz\n\nQuestion 1
of 5\n\nWhat is generative AI?\n\nAI that only processes data\n\nAI that creates content based on user
prompts\n\nAI that cannot update its data\n\nAI that performs physical tasks\n\nQuestion 1 Feedback for Option
1\n\nFalse. Typing on a keyboard is a manual activity that does not involve AI.\n\nQuestion 1 Feedback for Option
2\n\nFalse. Watching a sunset is a natural experience, not related to generative AI.\n\nQuestion 1 Feedback for
Option 3'}]
Out: None
[Step 1: Duration 2.20 seconds]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 2 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
─ Executing parsed code: ──────────────────────────────────────────────────────────────────────────────────────── use_cases_content_creation = genai_search(query="generative AI content creation use cases") print(use_cases_content_creation) ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Execution logs:
[{'id': '901846fb-fc97-42ef-810a-cedc8abfbcb8', 'score': 0.6875638961791992, 'text': '3. What is generative
AI?\n\nEven though AI is not new, you have probably been hearing a lot about easy-to-use, publicly available
Generative AI tools like ChatGPT and Google Gemini.\u202f \n\nBut what is generative AI?\u202f\u202f \n\nIt is a
type of AI technology that automatically generates (or creates) content in response to prompts given to it by
users.\u202f \n\nThese tools can generate text, images, music, video, code and other formats.'}, {'id':
'3d776586-b95b-4cad-8915-4d65926a5fe4', 'score': 0.6328049302101135, 'text': 'Question 2 Feedback for Option
1\n\nFalse. This describes data processing AI, not generative AI.\n\nQuestion 2 Feedback for Option 2 \n\nTrue.
Generative AI creates content like text, images, music, etc., in response to user prompts.\n\nQuestion 2 Feedback
for Option 3\n\nFalse. Generative AI can update its data with new information.\n\nQuestion 2 Feedback for Option 4
\n\nFalse. Generative AI focuses on content creation, not performing physical tasks.\n\nQuestion 3 of 5'}, {'id':
'cd369b7e-383b-42e2-bc5e-f514d260d7dd', 'score': 0.6124569177627563, 'text': 'Question 3 of 5\n\nWhich of the
following is a text generative AI tool?\n\nSpotify\n\nGoogle Maps\n\nDall-E2\n\nChatGPT\n\nQuestion 3 Feedback for
Option 1\n\nFalse. Spotify uses AI for music recommendations, not text generation.\n\nQuestion 3 Feedback for
Option 2\n\nFalse. Google Maps uses AI for navigation and travel information, not text generation.\n\n\n\nQuestion
3 Feedback for Option 3\n\nFalse. DALL-E2 generates images and art, not text.\n\nQuestion 3 Feedback for Option
4'}, {'id': '0b660b75-3bf3-47ab-a4bb-0f52039ec442', 'score': 0.582166314125061, 'text': 'An introduction to
generative AI\n\n1. Introduction\n\nThis activity will give a brief overview of what Generative AI is and how it is
being used.\n\nUsing this tutorial\n\nUse the back and next buttons at the bottom right of the screen to navigate
through the tutorial. Alternatively, use the contents button to jump to a specific page.\n\nYou will need to allow
approximately\xa05\xa0minutes\xa0to complete the tutorial.\n\nLearning outcomes\n\nAfter completing this tutorial
you will be able to:'}, {'id': 'ec272b15-9ff9-448b-a39b-3b89f0d6f524', 'score': 0.5623699426651001, 'text': '5.
Quiz\n\nQuestion 1 of 5\n\nWhat is generative AI?\n\nAI that only processes data\n\nAI that creates content based
on user prompts\n\nAI that cannot update its data\n\nAI that performs physical tasks\n\nQuestion 1 Feedback for
Option 1\n\nFalse. Typing on a keyboard is a manual activity that does not involve AI.\n\nQuestion 1 Feedback for
Option 2\n\nFalse. Watching a sunset is a natural experience, not related to generative AI.\n\nQuestion 1 Feedback
for Option 3'}]
Out: None
[Step 2: Duration 2.12 seconds]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 3 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
─ Executing parsed code: ──────────────────────────────────────────────────────────────────────────────────────── use_cases_applications = genai_search(query="applications of generative AI in various domains") print(use_cases_applications) ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Execution logs:
[{'id': '0b660b75-3bf3-47ab-a4bb-0f52039ec442', 'score': 0.5789191722869873, 'text': 'An introduction to generative
AI\n\n1. Introduction\n\nThis activity will give a brief overview of what Generative AI is and how it is being
used.\n\nUsing this tutorial\n\nUse the back and next buttons at the bottom right of the screen to navigate through
the tutorial. Alternatively, use the contents button to jump to a specific page.\n\nYou will need to allow
approximately\xa05\xa0minutes\xa0to complete the tutorial.\n\nLearning outcomes\n\nAfter completing this tutorial
you will be able to:'}, {'id': '901846fb-fc97-42ef-810a-cedc8abfbcb8', 'score': 0.5656728744506836, 'text': '3.
What is generative AI?\n\nEven though AI is not new, you have probably been hearing a lot about easy-to-use,
publicly available Generative AI tools like ChatGPT and Google Gemini.\u202f \n\nBut what is generative
AI?\u202f\u202f \n\nIt is a type of AI technology that automatically generates (or creates) content in response to
prompts given to it by users.\u202f \n\nThese tools can generate text, images, music, video, code and other
formats.'}, {'id': '3ab09f45-f5d2-468e-ae8e-710c116f51b7', 'score': 0.55094313621521, 'text': 'Recognise generative
AI in daily life: Identify common generative AI applications like chatbots, facial recognition, streaming services,
and digital assistants.\n\nUnderstand generative AI: Explain generative AI and its ability to create diverse
content such as text, images, music, video, and code.\n\nDescribe LLMs: Understand how\xa0Large Language Models
(LLMs) work.\n\n2. Examples of AI in everyday life'}, {'id': '14de7734-74a7-43c7-aa72-75a42655e545', 'score':
0.5244572162628174, 'text': 'surprisingly knowledgeable, or with an image / computing code. Although outputs
produced by Generative AI tools look plausible, they are often misleading, made up, or may be entirely
wrong.\n\nEach response is unique, you will probably never get the exact same reply twice.\n\nResponses are
conversational. Once you have asked a question you can just carry on the conversation by adding new questions or
prompts, rather than having to redo your search, as you would in a search engine like Google.'}, {'id':
'2751a020-1728-46d2-ae5c-0cfac3ee3d88', 'score': 0.5166183710098267, 'text': 'Online shopping – personalised
recommendations and adverts.\n\nDigital assistants, e.g.\u202fAmazon Alexa, Google Assistant, Siri.\n\nSending an
email – spell check and spam filters.\n\n\n\nTravel and navigation, e.g. Google Maps.\n\nWriting assistants, e.g.
Grammarly.\n\nHealth and fitness apps, e.g. Fitbit.\n\nSocial media feeds – AI controls the feeds that you get to
see while browsing through social media platforms (e.g., Facebook, X, Instagram) or the notifications you
receive.\n\n3. What is generative AI?'}]
Out: None
[Step 3: Duration 2.56 seconds]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 4 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
─ Executing parsed code: ──────────────────────────────────────────────────────────────────────────────────────── markdown_summary = """ # Generative AI Use Cases Generative AI refers to a category of artificial intelligence technologies that can create content in response to user prompts. Here are some key applications of generative AI: ## 1. Content Creation - **Text Generation**: Tools like ChatGPT generate coherent and relevant text based on prompts. - **Image Generation**: Models such as DALL-E create unique images from text descriptions. - **Music and Video Creation**: Generative models can compose music or create video clips based on user inputs. ## 2. Business Applications - **Personalized Recommendations**: In online shopping, generative AI analyzes user behavior to recommend products tailored to individual preferences. - **Chatbots and Digital Assistants**: Applications like Amazon Alexa and Google Assistant help users by providing information and performing tasks based on voice commands. ## 3. Health and Fitness - **Health Monitoring**: Apps like Fitbit use generative AI to analyze data and provide health recommendations. - **Telemedicine**: AI systems assist healthcare professionals by generating patient reports and insights based on input data. ## 4. Social Media - **Content Moderation**: Generative AI helps filter out harmful or inappropriate content from social media feeds. - **Algorithm-Driven Feeds**: AI systems personalize content delivery on platforms like Facebook and Instagram based on user interaction patterns. These use cases illustrate the versatility of generative AI across various sectors, enhancing both productivity and user experience. """ print(markdown_summary) final_answer(markdown_summary) ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Execution logs: # Generative AI Use Cases Generative AI refers to a category of artificial intelligence technologies that can create content in response to user prompts. Here are some key applications of generative AI: ## 1. Content Creation - **Text Generation**: Tools like ChatGPT generate coherent and relevant text based on prompts. - **Image Generation**: Models such as DALL-E create unique images from text descriptions. - **Music and Video Creation**: Generative models can compose music or create video clips based on user inputs. ## 2. Business Applications - **Personalized Recommendations**: In online shopping, generative AI analyzes user behavior to recommend products tailored to individual preferences. - **Chatbots and Digital Assistants**: Applications like Amazon Alexa and Google Assistant help users by providing information and performing tasks based on voice commands. ## 3. Health and Fitness - **Health Monitoring**: Apps like Fitbit use generative AI to analyze data and provide health recommendations. - **Telemedicine**: AI systems assist healthcare professionals by generating patient reports and insights based on input data. ## 4. Social Media - **Content Moderation**: Generative AI helps filter out harmful or inappropriate content from social media feeds. - **Algorithm-Driven Feeds**: AI systems personalize content delivery on platforms like Facebook and Instagram based on user interaction patterns. These use cases illustrate the versatility of generative AI across various sectors, enhancing both productivity and user experience. Out - Final answer: # Generative AI Use Cases Generative AI refers to a category of artificial intelligence technologies that can create content in response to user prompts. Here are some key applications of generative AI: ## 1. Content Creation - **Text Generation**: Tools like ChatGPT generate coherent and relevant text based on prompts. - **Image Generation**: Models such as DALL-E create unique images from text descriptions. - **Music and Video Creation**: Generative models can compose music or create video clips based on user inputs. ## 2. Business Applications - **Personalized Recommendations**: In online shopping, generative AI analyzes user behavior to recommend products tailored to individual preferences. - **Chatbots and Digital Assistants**: Applications like Amazon Alexa and Google Assistant help users by providing information and performing tasks based on voice commands. ## 3. Health and Fitness - **Health Monitoring**: Apps like Fitbit use generative AI to analyze data and provide health recommendations. - **Telemedicine**: AI systems assist healthcare professionals by generating patient reports and insights based on input data. ## 4. Social Media - **Content Moderation**: Generative AI helps filter out harmful or inappropriate content from social media feeds. - **Algorithm-Driven Feeds**: AI systems personalize content delivery on platforms like Facebook and Instagram based on user interaction patterns. These use cases illustrate the versatility of generative AI across various sectors, enhancing both productivity and user experience.
[Step 4: Duration 7.26 seconds]
from IPython.display import display, Markdown
display(Markdown(answer))
Generative AI Use Cases
Generative AI refers to a category of artificial intelligence technologies that can create content in response to user prompts. Here are some key applications of generative AI:
1. Content Creation
- Text Generation: Tools like ChatGPT generate coherent and relevant text based on prompts.
- Image Generation: Models such as DALL-E create unique images from text descriptions.
- Music and Video Creation: Generative models can compose music or create video clips based on user inputs.
2. Business Applications
- Personalized Recommendations: In online shopping, generative AI analyzes user behavior to recommend products tailored to individual preferences.
- Chatbots and Digital Assistants: Applications like Amazon Alexa and Google Assistant help users by providing information and performing tasks based on voice commands.
3. Health and Fitness
- Health Monitoring: Apps like Fitbit use generative AI to analyze data and provide health recommendations.
- Telemedicine: AI systems assist healthcare professionals by generating patient reports and insights based on input data.
4. Social Media
These use cases illustrate the versatility of generative AI across various sectors, enhancing both productivity and user experience.