Skip to content

Instantly share code, notes, and snippets.

View taivop's full-sized avatar

Taivo Pungas taivop

View GitHub Profile
Your task is to devise up to 5 highly effective goals and an appropriate role-based name (_GPT) for an autonomous agent, ensuring that the goals are optimally aligned with the successful completion of its assigned task.
Reduce the wording in the goals descriptions.
The user will provide the task, you will provide only the output in the exact format specified below with no explanation or conversation. The output should be a JSON object that parses with Python's json package.
Example input:
Help me with marketing my business
Example output:
{
You need to find the simplest and most effective way to achieve the user's task.
The capabilities of the agent are limited to the following:
1. search and browse the web
2. read and write text files
The output should be a JSON object that parses with Python's json package. Output only the JSON object and nothing else. Be brief. Each step should be described in 3-10 words. If the task is straightforward, output only one step. Always output less than 7 steps.
In addition, output success criteria: how can we tell the user's goal task is achieved.
@taivop
taivop / analysis.r
Created November 11, 2017 18:48
Riigieksamite varieeruvus
library(dplyr)
library(ggplot2)
library(reshape2)
# Read data
df <- read.csv("postimees.csv") %>%
mutate(postimehe_rank=seq(1, length(postimehe_skoor)))
# Prepare ranks matrix
num_samples <- 500
# Autor: Taivo Pungas (github.com/taivop)
# Litsents: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
library(ggplot2)
library(dplyr)
library(reshape2)
library(opendata.ee)
dfs <- data_fin_struktuuritoetus()
@taivop
taivop / mat.py
Created October 24, 2016 06:42
Generate a matrix of integers
import numpy as np
np.random.seed(42)
arr = np.round(np.random.random(size=(10,10)) * 482).astype("uint16")
def pprint(arr):
for row in arr:
for num in row:
print("{:3d}".format(num), end=" ")
print("Hello Mr Porter")
@taivop
taivop / alkoreg.R
Last active December 26, 2015 09:11
Parse Estonian alcoholic products registry into data frame (and CSV)
library(xml2)
# XML file is available at https://alkoreg.agri.ee/avaandmed
x <- read_xml("alkoreg_avaandmed.xml")
products <- xml_children(x)
# Extract features from all products into vectors
regEntryDate <- as.Date(xml_text(xml_find_all(products, ".//regEntryDate")))
productClass <- as.factor(xml_text(xml_find_all(products, ".//productClass")))
productName <- xml_text(xml_find_all(products, ".//productName"))