Skip to content

Instantly share code, notes, and snippets.

View vman's full-sized avatar
👨‍💻

Vardhaman Deshpande vman

👨‍💻
View GitHub Profile
{
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5",
"body": [
{ "type": "TextBlock", "text": "${title}", "size": "Large", "weight": "Bolder" },
{ "type": "FactSet", "facts": [
{ "title": "Temperature", "value": "${current.temperature_2m} °C" },
{ "title": "Wind", "value": "${current.wind_speed_10m} km/h" },
{ "title": "Time", "value": "${current.time}" },
{
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5",
"body": [
{ "type": "TextBlock", "text": "${title}", "size": "Medium", "weight": "Bolder" },
{ "type": "FactSet", "facts": [
{ "title": "Admin Area", "value": "${admin1}" },
{ "title": "Latitude", "value": "${latitude}" },
{ "title": "Longitude", "value": "${longitude}" }
import "@typespec/http";
import "@microsoft/typespec-m365-copilot";
using TypeSpec.Http;
using TypeSpec.M365.Copilot.Actions;
/* -------- Geocoding (city -> coords) -------- */
@service
@server("https://geocoding-api.open-meteo.com", "Open-Meteo Geocoding")
@actions(#{
import "@typespec/http";
import "@microsoft/typespec-m365-copilot";
import "./actions.tsp";
using TypeSpec.Http;
using TypeSpec.M365.Copilot.Agents;
@agent("Weather Helper", "Gets weather by city name using geocoding + forecast")
@instructions("""
When a user provides a city, first call searchCity to get latitude/longitude.
import "@typespec/http";
import "@typespec/openapi3";
import "@microsoft/typespec-m365-copilot";
import "./actions.tsp";
using TypeSpec.Http;
using TypeSpec.M365.Copilot;
using TypeSpec.M365.Copilot.Agents;
using TypeSpec.M365.Copilot.Actions;
{
"type": "AdaptiveCard",
"version": "1.5",
"layouts": [
{
"type": "Layout.AreaGrid",
"targetWidth": "AtLeast:Standard",
"columns": [
{
"physicalSize": 100,
{
"$schema": "https://developer.microsoft.com/json-schemas/copilot/declarative-agent/v1.2/schema.json",
"version": "v1.2",
"name": "MyFirstAgent${{APP_NAME_SUFFIX}}",
"description": "This declarative agent helps you with finding car repair records.",
"instructions": "$[file('instruction.txt')]",
"conversation_starters": [
{
"text": "Show repair records assigned to Karin Blair"
}
{
"$schema": "https://developer.microsoft.com/json-schemas/copilot/plugin/v2.2/schema.json",
"schema_version": "v2.2",
"namespace": "repairs",
"name_for_human": "MyFirstAgent${{APP_NAME_SUFFIX}}",
"description_for_human": "Track your repair records",
"description_for_model": "Plugin for searching a repair list, you can search by who's assigned to the repair.",
"functions": [
{
"name": "listRepairs",
openapi: 3.0.0
info:
title: Repair Service
description: A simple service to manage repairs
version: 1.0.0
servers:
- url: ${{OPENAPI_SERVER_URL}}/api
description: The repair api server
paths:
/repairs:
@vman
vman / api.ts
Last active January 29, 2025 15:42
import {
app,
HttpRequest,
HttpResponseInit,
InvocationContext,
} from "@azure/functions";
import repairRecords from "../repairsData.json";
/**