Skip to content

Commit

Permalink
Merge pull request #656 from polywrap/release/staging
Browse files Browse the repository at this point in the history
Release 12/22/23
  • Loading branch information
dOrgJelli authored Dec 21, 2023
2 parents d9ecf1e + c128a35 commit 651c59f
Show file tree
Hide file tree
Showing 243 changed files with 10,111 additions and 3,993 deletions.
39 changes: 28 additions & 11 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,37 +1,54 @@
################
### REQUIRED ###
################
######################
### CLI (required) ###
######################

# OPENAI_API_KEY
# Get it from https://platform.openai.com/account/api-keys
OPENAI_API_KEY=

# GPT_MODEL
# choose between gpt-3.5-turbo-16k-0613, gpt-4-0613 and gpt-3.5-turbo-0613
GPT_MODEL="gpt-4-0613"
# choose between gpt-4-1106-preview, gpt-3.5-turbo-16k-0613, gpt-4 and gpt-3.5-turbo-0613
GPT_MODEL="gpt-4-1106-preview"

# CONTEXT_WINDOW_TOKENS:
# The size of the context window, used for the agent's short-term memory
CONTEXT_WINDOW_TOKENS=8000
CONTEXT_WINDOW_TOKENS=128000

# MAX_RESPONSE_TOKENS
# The maximum size of the LLM's response
MAX_RESPONSE_TOKENS=2000
MAX_RESPONSE_TOKENS=4096

# SERP_API_KEY
# Get it from https://serpapi.com
# This is necessary for the webScraper.search script to work
SERP_API_KEY=

# Front-end authentication
##########################
### Browser (required) ###
##########################

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=

SUPABASE_URL=
SUPABASE_SERVICE_ROLE_KEY=
SUPABASE_JWT_SECRET=super-secret-jwt-token-with-at-least-32-characters-long

NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=

###########################################
### Browser (required for `yarn start`) ###
###########################################

# Can be anything
NEXTAUTH_JWT_SECRET=

#########################
### Common (optional) ###
#########################

# only required for `next dev`
NEXTAUTH_SECRET=
# Custom URL for the OpenAI API endpoint
OPENAI_API_BASE_URL=
123 changes: 60 additions & 63 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
ignorePatterns: [
"**/__tests__/**/*.*",
"**/node_modules/**/*.*",
"**/coverage/**/*.*"
"**/coverage/**/*.*",
],
overrides: [
{
Expand All @@ -12,38 +12,46 @@ module.exports = {
parserOptions: {
project: ["tsconfig.json", "./packages/**/tsconfig.json"],
},
plugins: [
"eslint-plugin-import",
"@typescript-eslint",
"prettier"
],
plugins: ["eslint-plugin-import", "@typescript-eslint", "prettier"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:json/recommended"
"plugin:json/recommended",
],
rules: {
"prettier/prettier": ["error"],
"spaced-comment": ["error", "always", { "markers": ["/"] }],
"spaced-comment": ["error", "always", { markers: ["/"] }],
"@typescript-eslint/naming-convention": [
"error",
{selector: "default", format: ["camelCase"]},
{ selector: "default", format: ["camelCase"] },
{
selector: [
"classProperty", "parameterProperty", "objectLiteralProperty",
"classMethod", "parameter"
"classProperty",
"parameterProperty",
"objectLiteralProperty",
"classMethod",
"parameter",
],
format: ["camelCase"], leadingUnderscore: "allow"
format: ["camelCase"],
leadingUnderscore: "allow",
},
//wrap host methods doesn't satisfy neither camel or snake
{selector: ["objectLiteralMethod", "typeMethod"], filter: {regex: "^_wrap_.*", match: true}, format: null},
{
selector: ["objectLiteralMethod", "typeMethod"],
filter: { regex: "^_wrap_.*", match: true },
format: null,
},
//variable must be in camel or upper case
{selector: "variable", format: ["camelCase", "UPPER_CASE"], leadingUnderscore: "allow"},
{
selector: "variable",
format: ["camelCase", "UPPER_CASE"],
leadingUnderscore: "allow",
},
//classes and types must be in PascalCase
{selector: ["typeLike", "enum"], format: ["PascalCase"]},
{selector: "enumMember", format: null},
{ selector: ["typeLike", "enum"], format: ["PascalCase"] },
{ selector: "enumMember", format: null },
//ignore rule for quoted stuff
{
selector: [
Expand All @@ -54,82 +62,71 @@ module.exports = {
"objectLiteralMethod",
"typeMethod",
"accessor",
"enumMember"
"enumMember",
],
format: null,
modifiers: ["requiresQuotes"]
modifiers: ["requiresQuotes"],
},
//ignore rules on destructured params
{
selector: "variable",
modifiers: ["destructured"],
format: null
}
format: null,
},
],
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/member-ordering": [
"error", {
classes: {
order: "as-written",
memberTypes: [
// Constructors
"public-constructor",
"protected-constructor",
"private-constructor",

// Methods
"public-static-method",
"public-abstract-method",
"public-instance-method",
"public-decorated-method",
"protected-static-method",
"protected-abstract-method",
"protected-instance-method",
"protected-decorated-method",
"private-static-method",
"private-abstract-method",
"private-instance-method",
"private-decorated-method",
],
},
"error",
{
default: ["signature", "constructor", "method", "field"],
},
],
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-unused-vars": ["error", {
"varsIgnorePattern": "^_",
"argsIgnorePattern": "^_",
}],
"@typescript-eslint/no-unused-vars": [
"error",
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-floating-promises": "error",
"import/no-extraneous-dependencies": ["error", {
"devDependencies": false,
"optionalDependencies": true,
"peerDependencies": false
}],
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: false,
optionalDependencies: true,
peerDependencies: false,
},
],
"import/order": [
"error",
{
"groups": [["index", "sibling", "parent", "internal"], ["external", "builtin"], "object"],
"newlines-between": "always"
}
]
groups: [
["index", "sibling", "parent", "internal"],
["external", "builtin"],
"object",
],
"newlines-between": "always",
},
],
},
},
{
files: ["**/__tests__/**/*.ts", "*.spec.ts"],
rules: {
"import/no-extraneous-dependencies": "off"
}
"import/no-extraneous-dependencies": "off",
},
},
{
files: ["*.d.ts"],
rules: {
"@typescript-eslint/triple-slash-reference": "off"
}
"@typescript-eslint/triple-slash-reference": "off",
},
},
{
files: ["*.json"],
extends: ["plugin:json/recommended"],
}
]
},
],
};
6 changes: 3 additions & 3 deletions .github/workflows/benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ jobs:
run: yarn start:api -c &
env:
OPENAI_API_KEY: ${{ secrets.BENCHMARK_CI_OPENAI_API_KEY }}
GPT_MODEL: "gpt-4-0613"
CONTEXT_WINDOW_TOKENS: 8000
MAX_RESPONSE_TOKENS: 2000
GPT_MODEL: "gpt-4-1106-preview"
CONTEXT_WINDOW_TOKENS: 128000
MAX_RESPONSE_TOKENS: 4096
SERP_API_KEY: ${{ secrets.BENCHMARK_CI_SERP_API_KEY }}

- name: Set up Python 3.10
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ jobs:
- name: Build
run: yarn build
env:
CI: false
NEXT_PUBLIC_SUPABASE_URL: http://127.0.0.1:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY: supabase-anon-key
29 changes: 29 additions & 0 deletions .github/workflows/db-production-migration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: db-production-migration

on:
push:
branches:
- release/prod

jobs:
migrate:
runs-on: ubuntu-latest

env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_PRODUCTION_DB_PASSWORD }}
SUPABASE_PRODUCTION_PROJECT_ID: ${{ secrets.SUPABASE_PRODUCTION_PROJECT_ID }}

defaults:
run:
working-directory: ./apps/browser

steps:
- uses: actions/checkout@v3

- uses: supabase/setup-cli@v1
with:
version: latest

- run: supabase link --project-ref $SUPABASE_PRODUCTION_PROJECT_ID
- run: supabase db push
29 changes: 29 additions & 0 deletions .github/workflows/db-staging-migration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: db-staging-migration

on:
push:
branches:
- release/staging

jobs:
migrate:
runs-on: ubuntu-latest

env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_STAGING_DB_PASSWORD }}
SUPABASE_STAGING_PROJECT_ID: ${{ secrets.SUPABASE_STAGING_PROJECT_ID }}

defaults:
run:
working-directory: ./apps/browser

steps:
- uses: actions/checkout@v3

- uses: supabase/setup-cli@v1
with:
version: latest

- run: supabase link --project-ref $SUPABASE_STAGING_PROJECT_ID
- run: supabase db push
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,12 @@ db
!/benchmarks/agbenchmark_config/config.json
/benchmarks/agbenchmark_config

/apps/browser/src/scripts.ts
.next
/apps/browser/lib/scripts.ts
.next

.DS_Store
yarn-error.log

# Supabase
.branches
.temp
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,12 @@ Once the evo.ninja CLI is run, there will be a `./sessions` directory created, w

## UI

Just run:
> `yarn start:browser`
The UI depends on [Supabase Database](https://supabase.com/). In order to run it locally you must have [Docker Desktop](https://docs.docker.com/get-docker/) installed and running.

0. Make sure you've followed installation steps above
1. Go to `cd apps/browser`
2. Run `yarn db:start` - This can take up to ~3 minutes, since it will download all the images needed by supabase
3. Update `.env.local` with:
- `NEXT_PUBLIC_SUPABASE_URL` will have the value of `API URL`
- `SUPABASE_SERVICE_ROLE_KEY` will have the value of `service_role key`
4. Run the UI with `yarn dev`
17 changes: 0 additions & 17 deletions apps/browser/api-utils/supabase.ts

This file was deleted.

11 changes: 11 additions & 0 deletions apps/browser/app/api/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { getAuthOptions } from "@/lib/api/authOptions";
import NextAuth from "next-auth";
import { NextRequest } from "next/server";

export function GET(req: NextRequest, res: any) {
return NextAuth(req, res, getAuthOptions())
}

export function POST(req: NextRequest, res: any) {
return NextAuth(req, res, getAuthOptions())
}
Loading

0 comments on commit 651c59f

Please sign in to comment.