Back to Nexa Sdk

NexaAI VLM Function Call Demo with Google Calendar MCP

cookbook/PC/function-calling/README.md

0.2.732.5 KB
Original Source

NexaAI VLM Function Call Demo with Google Calendar MCP

Demonstrates function calling capabilities of NexaAI/OmniNeural-4B model, integrated with Google Calendar via MCP protocol.

Features

  • Function calling with NexaAI VLM model
  • Google Calendar integration via MCP
  • Automatic function call parsing and execution
  • Multi-modal input support (text, image, audio)
  • Web UI and command-line interfaces

Prerequisites

Installation

bash
pip install -r requirements.txt

Google Calendar Setup

  1. Go to Google Cloud Console

  2. Create/select a project and enable Google Calendar API

  3. Go to OAuth consent screen follow the instructions to configure your consent screen.

  4. Create OAuth 2.0 credentials:

    • Go to Credentials
    • Create "Create Credentials" > "OAuth client ID" > Select "Desktop app" > click "Create"
    • Click "Download JSON" and save as gcp-oauth.keys.json on the same directory as this README.md
  5. Add your email as a test user in Audience

    • Click "Add User" > enter your email address > click "Save"
    • Note: Test mode tokens expire after 1 week
  6. Authenication (only need to do once)

powershell
$env:GOOGLE_OAUTH_CREDENTIALS="gcp-oauth.keys.json"
npx @cocal/google-calendar-mcp auth

follow the instructions to authorize the application to access your Google Calendar.

Tip: Ensure the OAuth client ID is enabled for Calendar API at Credentials For detailed setup, see: https://github.com/nspady/google-calendar-mcp?tab=readme-ov-file#google-cloud-setup

Usage

Command Line

bash
# Text only
python main.py --text "what is the time now?"

# Image with text
python main.py --image image.png --text "help me add this event to my calendar"

# Audio with text
python main.py --audio audio.mp3 --text "transcribe and add to calendar"

Web UI

powershell
python .\app\flask_ui.py