Skip to content

Instantly share code, notes, and snippets.

import os
os.environ["OPENAI_API_KEY"] = "<KEY>"
os.environ["OPENAI_ORGANIZATION"] = '<ORG>'
from crewai import Agent, Task, Crew
from langchain_openai import ChatOpenAI
OpenAIGPT4oMini = ChatOpenAI(model_name="gpt-4o-mini", temperature=0.1)
purpose = "To serve as the ultimate digital companion for NBA fans, providing real-time access to games, highlights, player stats, and exclusive content. The app aims to deepen fan engagement by offering personalized experiences, interactive features, and seamless integration with NBA events and merchandise."
@naikparag
naikparag / main.py
Created March 21, 2019 18:24
Simple python script to download images by reading urls from a txt file
import requests
import pathlib
filename = "download.txt"
target = "nike/bags/"
def downloadFromFile():
pathlib.Path(target).mkdir(parents=True, exist_ok=True)
@naikparag
naikparag / minikube commands
Last active October 2, 2018 10:13
Kubernetes
pn@bigfoot:/tmp$ sudo minikube version
minikube version: v0.29.0
pn@bigfoot:/tmp$ sudo kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.3", GitCommit:"a4529464e4629c21224b3d52edfe0ea91b072862", GitTreeState:"clean", BuildDate:"2018-09-09T18:02:47Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:44:10Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
pn@bigfoot:/tmp$ sudo kubectl cluster-info
@naikparag
naikparag / Ubuntu 18 | ML Setup | 1080 GPU
Last active October 2, 2018 09:46
Instructions for Ubuntu setup for Machine Learning Box using Nvidia GTX 1080 GPU
##
## DRIVERS
# Check which card is being used right now.
prime-select query
# Switch to Intel integrated GPU
sudo prime-select intel
# Switch to Nvidia GPU
sudo prime-select nvidia
@naikparag
naikparag / nodejs-custom-es6-errors.md
Created September 4, 2018 01:27 — forked from slavafomin/nodejs-custom-es6-errors.md
Custom ES6 errors in Node.js

Here's how you could create custom error classes in Node.js using latest ES6 / ES2015 syntax.

I've tried to make it as lean and unobtrusive as possible.

Defining our own base class for errors

errors/AppError.js

@naikparag
naikparag / App.js
Created June 11, 2017 05:21
React Native Gist
class App extends Component {
onAddTodo = (text) => {
const {dispatch} = this.props
dispatch (actionCreators.add(text))
}
render() {
const {todos} = this.props