Skip to content

Instantly share code, notes, and snippets.

// translation-agent.js
import express from "express";
const app = express();
app.use(express.json());
// IMPLICIT CONTRACT: expects req.body.text
app.post("/translate", async (req, res) => {
const text = req.body?.text;
const supportedLanguages = ["es", "fr", "de"];
// summary-agent.js
import fetch from "node-fetch";
async function generateReviewSummary(reviewText: string[]) {
// Step 1: Generate summary using LLM
// (This is a placeholder for actual LLM integration)
const summary = `Summary: ${reviewText.join(", ")}`;
// Step 2: Invoke translation agent
const payload = { text: summary };
import { Server } from "@modelcontextprotocol/server";
import { stdioServer } from "@modelcontextprotocol/server/stdio";
import { TextContent } from "@modelcontextprotocol/types";
async function serve() {
const server = new Server("refund-agent");
// Advertise available tools
server.listTools(async () => [
{
// translation-agent.js
import express from "express";
const app = express();
app.use(express.json());
// IMPLICIT CONTRACT: expects req.body.text
app.post("/translate", async (req, res) => {
const text = req.body?.text;
const supportedLanguages = ["es", "fr", "de"];
import { Server } from "@modelcontextprotocol/server";
import { stdioServer } from "@modelcontextprotocol/server/stdio";
import { TextContent } from "@modelcontextprotocol/types";
async function serve() {
const server = new Server("refund-agent");
// Advertise available tools
server.listTools(async () => [
{
// summary-agent.js
import fetch from "node-fetch";
async function generateReviewSummary(reviewText: string[]) {
// Step 1: Generate summary using LLM
// (This is a placeholder for actual LLM integration)
const summary = `Summary: ${reviewText.join(", ")}`;
// Step 2: Invoke translation agent
const payload = { text: summary };
import java.util.Random;
public class RandomExample {
public static void main(String[] args) {
Random rand = new Random();
int randomNumber = rand.nextInt(100) + 1; // 1 to 100
System.out.println("Random number: " + randomNumber);
}
}
const benchmarkData = require('/home/circleci/benchmarks/com.circleci.samples.todoapp.macrobenchmark-benchmarkData.json')
const COLD_STARTUP_MEDIAN_THRESHOLD_MILIS = YOUR_COLD_THRESHOLD
const WARM_STARTUP_MEDIAN_THRESHOLD_MILIS = YOUR_WARM_THRESHOLD
const HOT_STARTUP_MEDIAN_THRESHOLD_MILIS = YOUR_HOT_THRESHOLD
const coldMetrics = benchmarkData.benchmarks.find(element => element.params.mode === "COLD").metrics.startupMs
const warmMetrics = benchmarkData.benchmarks.find(element => element.params.mode === "WARM").metrics.startupMs
const hotMetrics = benchmarkData.benchmarks.find(element => element.params.mode === "HOT").metrics.startupMs
- run:
name: Evaluate benchmark results
command: node scripts/eval_startup_benchmark_output.js
- run:
name: Download benchmark data
command: |
mkdir ~/benchmarks
gsutil cp -r 'gs://android-sample-benchmarks/macrobenchmark/**/artifacts/sdcard/Download/*' ~/benchmarks
gsutil rm -r gs://android-sample-benchmarks/macrobenchmark
- store_artifacts:
path: ~/benchmarks