AutoGPT is an extension of ChatGPT to automatically run an agent to complete a solution without human intervention.
Normally, an OpenAI API key is used.
For Azure OpenAI, you must use either an API token or an Azure Active Directory account.
def split_text(text, chunk_size=500, separators=['\n\n', '.\n', ':\n', '\n', '. ', ', ', " ", ""]): | |
"""Split text into chunks of size less than chunk_size, using separators.""" | |
chunks = [] | |
current_separator_index = 0 | |
for separator in separators: | |
current_separator_index += 1 | |
if len(text) < chunk_size: | |
if len(text) > 0: | |
chunks.append(text) |
Manually download Windows Subsystem for Linux distro packages: | |
# @link: https://docs.microsoft.com/en-us/windows/wsl/install-manual#installing-your-distro | |
Windows Subsystem for Linux Installation Guide for Windows 10: | |
# @link: https://docs.microsoft.com/en-us/windows/wsl/install-win10#set-your-distribution-version-to-wsl-1-or-wsl-2 | |
Updating Wsl : | |
Download Msi Wsl update package from below link then install it : | |
@link : https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi |
class PathMe { | |
moves: string[] = []; | |
constructor() { | |
this.moves = []; | |
return this; | |
} | |
moveTo(x: number, y: number) { |
AutoGPT is an extension of ChatGPT to automatically run an agent to complete a solution without human intervention.
Normally, an OpenAI API key is used.
For Azure OpenAI, you must use either an API token or an Azure Active Directory account.
//Snippet from Program.cs which adds the provider and sets up a Settings class to map the settings | |
using ErikNoren.Configuration; | |
using TestMvcWebApplication; | |
var builder = WebApplication.CreateBuilder(args); | |
builder.Configuration.AddSqlDatabase(config => | |
{ | |
//We can get the connection string from previously added ConfigurationProviders to use in setting this up | |
config.ConnectionString = builder.Configuration.GetConnectionString("DemoDatabase"); |
import { Browser, chromium, firefox, webkit } from "playwright"; | |
import { afterAll, beforeAll, describe, it } from "vitest"; | |
const browserTypes = process.env.ALL_BROWSERS | |
? [chromium, firefox, webkit] | |
: [chromium]; | |
for (const browserType of browserTypes) { | |
describe(`browser:${browserType.name()}`, () => { | |
let browser: Browser; |
type None = { | |
flatMap<U>(f: (value: null) => Option<U>): None | |
getOrElse<U>(def: U): U | |
isEmpty(): true | |
map<U>(f: (value: null) => U): None | |
nonEmpty(): false | |
orElse<U>(alternative: Option<U>): Option<U> | |
} | |
type Some<T> = { |
// @see http://www.scala-lang.org/api/2.7.4/scala/Option.html | |
class Opt<A> { | |
value: A | null | |
// TODO: use constructor fn instead | |
static from<A>(value: A | null): Opt<A> { | |
return value == null ? None : Some(value) | |
} |
// orignal author @dylanvdmerwe - https://dev.to/dylanvdmerwe/reduce-angular-style-size-using-purgecss-to-remove-unused-styles-3b2k | |
const exec = require("child_process").exec; | |
const fs = require("fs"); | |
const path = require("path"); | |
const chalk = require("chalk"); | |
function removeUnusedCSS() { | |
var pathPrefix = process.argv.slice(2)[0]; | |
// find the styles css file | |
const files = getAllFiles(`./${pathPrefix}/`, ".css"); |
/* Attribution: http://techslides.com/how-to-parse-and-search-json-in-javascript */ | |
//return an array of objects according to key, value, or key and value matching | |
function getObjects(obj, key, val) { | |
var objects = []; | |
for (var i in obj) { | |
if (!obj.hasOwnProperty(i)) continue; | |
if (typeof obj[i] == 'object') { | |
objects = objects.concat(getObjects(obj[i], key, val)); | |
} else |