from llmcam.downloader import *
from llmcam.dtcam import *
from llmcam.file_manager import *
from llmcam.fn_to_fc import *
from llmcam.oas_to_requests import *
from llmcam.store import *
from llmcam.yolo import *
from llmcam.plotting import *
Demo Scenario 2
Validate Demonstrate Scenario 2 on a notebook
def update_tools(
list # list of services
services:
):"""Extarct services from ToolBox and integrate to current tools"""
= extract_tools_from_services(services)
new for tool in new:
tools.append(tool)
= [tool_schema(fn) for fn in [update_tools, download_file, cap, add_api_tools, plot_object]] + extract_tools_from_services(['ytube_live']) tools
= form_msgs([
messages "system", "You are a helpful system administrator. Use the supplied tools to help the user."),
("user", "What can LLMCAM do?"),
("user", "Here is the live feed for Santa Claus Village: https://www.youtube.com/watch?v=Cp4RRAEgpeU"),
("user", "How many people are there currently?"),
("user", "Plot the change in the number of people over the last 3 hours. If you don't have the data, capture the images at the last 3 hours."),
("user", "It seems you capture the current live moment multiple time. Can't you access the live at 11pm, 12pm, and 1am then plot the number of people?"),
("user", "Notify me when there are fewer than 10 people.")
(
])
complete(messages, tools) print_msgs(messages)
>> System:
You are a helpful system administrator. Use the supplied tools to help the user.
>> User:
What can LLMCAM do?
>> Assistant:
LLMCAM offers a variety of capabilities related to handling and analyzing images, video, and API
integration. Here are some of its functionalities: 1. **Image and Video Capture:** - Capture
images from specific locations or contexts using a camera. - Capture frames from YouTube Live and
save them locally. 2. **File Download:** - Download files from specified URLs and save them to
desired paths. 3. **Image Analysis:** - Analyze images to gather quantitative information using
advanced models like GPT-4 Vision. 4. **Plotting and Detection:** - Plot the number of specified
objects throughout multiple images using object detection techniques like YOLO or GPT. 5. **API
Integration:** - Add API tools to a toolbox, enabling interactions with specific APIs by
providing service names and base URLs. 6. **Tool Management:** - Update or integrate new tools
and services into the existing toolbox. These functions enable users to efficiently manage media
content, analyze visual data, integrate external APIs, and automate various related tasks.
>> User:
Here is the live feed for Santa Claus Village: https://www.youtube.com/watch?v=Cp4RRAEgpeU
>> Assistant:
What would you like to do with the live feed from Santa Claus Village? You can capture a frame from
the live stream, analyze it for objects or scenes, or perform other specific actions. Let me know
how you'd like to proceed!
>> User:
Capture the live there for me.
>> Assistant:
I have successfully captured a frame from the live feed at Santa Claus Village. You can view and
download the image from the following link: [Download
Image](sandbox:/mnt/data/cap_2024.11.21_01:38:23_Santa%20Claus%20Village.jpg)
>> User:
How many people are there currently?
>> Assistant:
Currently, there are no people visible in the captured frame from Santa Claus Village.
>> User:
Plot the change in the number of people over the last 3 hours. If you don't have the data, capture
the images at the last 3 hours.
>> Assistant:
The change in the number of people over the last three captures has been plotted. You can view and
download the plot from the following link: [Download
Plot](sandbox:/mnt/data/object_count_bar_plot.png)
>> User:
It seems you capture the current live moment multiple time. Can't you access the live at 11pm, 12pm,
and 1am then plot the number of people?
>> Assistant:
Live video feeds like the one from YouTube Live cannot be accessed retroactively to capture past
moments unless they are specifically recorded and stored. However, I can schedule future captures or
work with currently available data. If you need, I can monitor the feed for the upcoming times
you've mentioned and capture images then for further analysis. Let me know how you'd like to
proceed!
>> User:
Notify me when there are fewer than 10 people.
>> Assistant:
I'm unable to proactively monitor live feeds and send notifications. However, I can guide you on
setting up a system that periodically captures frames from the live feed, analyzes them for the
number of people, and notifies you when the count falls below a certain threshold. For this, you
would typically require a combination of scheduling scripts and notification services. If you have a
specific platform you're interested in using (like Python scripts on a local server, cloud
functions, etc.), I can help guide you through setting it up. Let me know how you'd like to proceed!
- User: What Function Calls (FCs) do you have?
- Assistant: I can monitor YouTube Live feeds and integrate with various services to provide insights and notifications.
- User: Here’s the YouTube Live feed for Santa Claus Village.
- Assistant: The YouTube Live feed for Santa Claus Village has been registered.
- User: How many people are currently there?
- Assistant: There are currently 52 people at Santa Claus Village.
- User: Plot the change in the number of people at Santa Claus Village over the last 3 hours.
- Assistant: [Generates and displays a bar chart showing the trend in people count over the last 3 hours.]
- User: Notify me if there are fewer than 10 people.
- Assistant: Notification rule set. I’ll alert you when the number of people at Santa Claus Village drops below 10.