Skip to content

Instantly share code, notes, and snippets.

View timothymugayi's full-sized avatar
🎯
Focusing

Timothy Mugayi timothymugayi

🎯
Focusing
View GitHub Profile
@timothymugayi
timothymugayi / langchain_openapi_schema_prompt_debug.log
Created June 10, 2023 02:16
langchain_openapi_schema_prompt_debug.log
Answer the following questions as best you can. You have access to the following tools:
spoonacular_API.searchRecipes: I'm an AI from spoonacular API. Instruct what you want, and I'll assist via an API with description: Search through hundreds of thousands of recipes using advanced filtering and ranking. NOTE: This method combines searching by query, by ingredients, and by nutrients into one endpoint.
spoonacular_API.searchRecipesByIngredients: I'm an AI from spoonacular API. Instruct what you want, and I'll assist via an API with description:
Ever wondered what recipes you can cook with the ingredients you have in your fridge or pantry? This endpoint lets you find recipes that either maximize the usage of ingredients you have at hand (pre shopping) or minimize the ingredients that you don't currently have (post shopping).
spoonacular_API.searchRecipesByNutrients: I'm an AI from spoonacular API. Instruct what you want, and I'll assist via an API with description: Find a set of recipes that adhere t
import os
import math
import dask.dataframe as dd
import numpy as np
import pandas as pd
from dask.distributed import Client
client = Client('tcp://scheduler:8786')
$ serverless invoke --function currentTime --log --profile localstack --stage local
Serverless: config.options_stage: local
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: ${opt:stage, 'local'}
Serverless: config.stage: local
Serverless: Using serverless-localstack
Serverless: Reconfiguring service apigateway to use http://localhost:4567
Serverless: Reconfiguring service cloudformation to use http://localhost:4581
Serverless: Reconfiguring service cloudwatch to use http://localhost:4582
Serverless: Reconfiguring service lambda to use http://localhost:4574
service: simple-http-endpoint
frameworkVersion: ">=1.2.0 <2.0.0"
plugins:
- serverless-localstack
# - serverless-python-requirements
provider:
name: aws
import os
import json
import uuid
import boto3
# Inside docker use docker dns name localstack
# os.environ['LOCALSTACK_SQS_ENDPOINT_URL'] = 'http://localstack:4576'
# If your connecting to the localstack outside docker use host dns
# each aws service has its own endpoint url ensure boto3 client is configured accordingly
#!/usr/bin/env bash
printf "Configuring localstack components..."
readonly LOCALSTACK_S3_URL=http://localstack:4572
readonly LOCALSTACK_SQS_URL=http://localstack:4576
sleep 5;
set -x
version: "3.7"
services:
localstack:
container_name: "${LOCALSTACK_DOCKER_NAME-localstack}"
image: localstack/localstack
hostname: localstack
networks:
- localstack-net
ports:
- "4566-4599:4566-4599"
# Subscribers are created with ZMQ.SUB socket types.
# A zmq subscriber can connect to many publishers.
import sys
import zmq
port = "5556"
if len(sys.argv) > 1:
port = sys.argv[1]
int(port)
# Publishers are created with ZMQ.PUB socket types
# Data is published along with a topic.The subscribers usually
# sets a filter on these topics for topic of their interests.
# A publisher has no connected subscribers, then it will simply drop all messages.
# If you’re using TCP, and a subscriber is slow, messages will queue up on the publisher.
# In the current versions of ØMQ, filtering happens at the subscriber side, not the publisher side.
import zmq
import random
import cv2
import zmq
import numpy as np
port = "5555"
context = zmq.Context()
footage_socket = context.socket(zmq.SUB)
footage_socket.connect("tcp://localhost:%s" % port)
footage_socket.setsockopt_string(zmq.SUBSCRIBE, np.unicode(''))