Skip to content

Instantly share code, notes, and snippets.

@homanp
homanp / api-example.ts
Last active May 14, 2024 17:18
Superagent API Request.
const apiUrl =
"https://api.beta.superagent.sh/api/v1/workflows/7261d731-9174-4659-9fcc-df4384058263/invoke";
const outputSchema = {
type: "object",
properties: {
website: { type: "string" },
industry: { type: "string" },
number_of_employees: { type: "number" },
company_type: {
@homanp
homanp / airtable-script.js
Created March 29, 2024 19:38
Airtable Automation script
let inputConfig = input.config();
const {recordId} = inputConfig
await fetch(
"https://tables.superagent.sh/api/workflows",
{
method: "POST",
body: JSON.stringify(
{
// REPLACE this with your workflow ID inside the Superagent dashboard
@homanp
homanp / saml-examples.yaml
Last active February 23, 2024 07:52
SAML examples
# Simple RAG
workflows:
- superagent:
llm: gpt-4-1106-preview
data:
urls:
- https://s2.q4cdn.com/299287126/files/doc_financials/2023/q3/AMZN-Q3-2023-Earnings-Release.pdf
use_for: Answering questions about earning reports
name: Earnings assistant
intro: 👋 Hi there! How can I help you?
@homanp
homanp / superagent.yml
Last active March 13, 2024 18:43
SAML
workflows:
- superagent:
name: My assistant
llm: gpt-4-1106-preview
prompt: You are a helpful AI assitant.
intro: 👋 Hi there! How can I help you?
data: # This is for structured and unstructured data
use_for: Querying internal data
urls:
- https://acme.inc/test.pdf
@homanp
homanp / workflow.yaml
Last active January 24, 2024 22:36
SA Workflow Language
workflow:
assistant:
name: my assistant
description: my assistant description
llm: gpt-3.5-turbo-16k-0613 # The regular name of the model
prompt: My prompt
intro_message: Hello there!
tools:
browser:
# Optional
@homanp
homanp / reference-collecter.js
Created January 24, 2024 08:19
Reference collector
import { SuperAgentClient } from "superagentai-js";
const client = new SuperAgentClient({
token: process.env["SUPERAGENT_API_KEY"],
environment: "https://api.beta.superagent.sh",
});
async function createAgent(name, description, llmModel, prompt, isActive) {
return client.agent.create({
name,
@homanp
homanp / drymerge-openapi.yaml
Created January 2, 2024 08:30
drymerge-openapi-spec
openapi: 3.0.0
info:
title: ThingAPI
description: Does a thing.
version: v1.0.0
servers:
- url: https://api.drymergeqa.com
paths:
/execute/DryMerge/~/demo.api:
post:
@homanp
homanp / superagent_render.md
Last active January 20, 2024 21:27
Deploy Superagent on Render

Deploy Superagent to Render

This guide shows you how to deploy the Superagent API to Render.com

  1. Create a new Web service from within the Render dashboard.

  2. Select Build and deploy from a Git repository.

Screenshot 2023-11-05 at 23 28 24

  1. Connect your Superaget fork from the list of repositories.
@homanp
homanp / main.ts
Last active November 1, 2023 18:59
Superagent Github Researcher
// npm i superagentai-js
import { SuperAgentClient } from "superagentai-js";
const GITHUB_REPO_URL = "https://github.com/homanp/nagato";
const PROMPT = `You are a helpful AI assistant that's an expert at answering questions about the following Github repository: ${GITHUB_REPO_URL}\n\nAlways use the functions provided to answer all questions by the user.`;
interface Agent {
id: string;
name: string;
@homanp
homanp / create.js
Last active October 2, 2023 19:35
create.js
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const superagentToken = "";
const agentId = "";
const channelId = context.params.event.channel_id;
const authorId = context.params.event.author.id;
const [response] = await Promise.all([
fetch(`https://api.beta.superagent.sh/api/v1/agents/${agentId}/invoke`, {
method: "POST",
headers: {
"content-type": "application/json",