Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update some fixed models to default aliases #260

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions browser/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import express, { type Request, type Response } from 'express'
import bodyParser from 'body-parser'
import { type Page } from 'playwright'
import { browse, filterContent } from './browse.ts'
import { fill } from './fill.ts'
import { enter } from './enter.ts'
import { scrollToBottom } from './scrollToBottom.ts'
import { randomBytes } from 'node:crypto'
import { getSessionId, SessionManager } from './session.ts'
import { screenshot, ScreenshotInfo } from './screenshot.ts'
import express, {type Request, type Response} from "express"
import bodyParser from "body-parser"
import {type Page} from "playwright"
import {browse, filterContent} from "./browse.ts"
import {fill} from "./fill.ts"
import {enter} from "./enter.ts"
import {scrollToBottom} from "./scrollToBottom.ts"
import {randomBytes} from "node:crypto"
import {getSessionId, SessionManager} from "./session.ts"
import {screenshot, ScreenshotInfo} from "./screenshot.ts"

async function main (): Promise<void> {
console.log('Starting browser server')
Expand All @@ -29,7 +29,7 @@ async function main (): Promise<void> {
app.post('/*', async (req: Request, res: Response) => {
const data = req.body

const model: string = data.model ?? 'gpt-4o-mini'
const model: string = data.model ?? process.env.OTTO8_DEFAULT_LLM_MINI_MODEL ?? 'gpt-4o-mini'
const website: string = data.website ?? ''
const userInput: string = data.userInput ?? ''
const keywords: string[] = (data.keywords ?? '').split(',')
Expand Down
6 changes: 3 additions & 3 deletions google/search/src/refine.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GPTScript, type ToolDef } from '@gptscript-ai/gptscript'
import { type SearchResults, type SearchResult } from './search.ts'
import {GPTScript, type ToolDef} from "@gptscript-ai/gptscript"
import {type SearchResult, type SearchResults} from "./search.ts"

const gptscript = new GPTScript()

Expand Down Expand Up @@ -34,7 +34,7 @@ async function refineResult (
const tool: ToolDef = {
chat: false,
jsonResponse: true,
modelName: 'gpt-4o-mini',
modelName: process.env.OTTO8_DEFAULT_LLM_MINI_MODEL ?? 'gpt-4o-mini',
temperature: 0.0,
arguments: {
type: 'object',
Expand Down
2 changes: 1 addition & 1 deletion google/youtube/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Transcript(BaseModel):


async def get_clean_transcript(text: str) -> Transcript:
model = os.getenv('MODEL', 'gpt-4o')
model = os.getenv('MODEL', os.getenv('OTTO8_DEFAULT_LLM_MODEL', 'gpt-4o'))
if text is None or text == '':
raise ValueError('Error: no transcript text provided')

Expand Down
14 changes: 7 additions & 7 deletions images/src/analyze.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { fileTypeFromBuffer } from 'file-type';
import { resolve } from 'path';
import { readFile } from 'fs/promises';
import OpenAI from 'openai';
import { ChatCompletionContentPartImage } from 'openai/resources/chat/completions';
import { GPTScript } from '@gptscript-ai/gptscript';
import {fileTypeFromBuffer} from "file-type"
import {resolve} from "path"
import {readFile} from "fs/promises"
import OpenAI from "openai"
import {ChatCompletionContentPartImage} from "openai/resources/chat/completions"
import {GPTScript} from "@gptscript-ai/gptscript"

export async function analyzeImages(
prompt: string = '',
Expand Down Expand Up @@ -37,7 +37,7 @@ export async function analyzeImages(

const openai = new OpenAI();
const response = await openai.chat.completions.create({
model: 'gpt-4o',
model: process.env.OTTO8_DEFAULT_VISION_MODEL ?? 'gpt-4o',
stream: true,
messages: [
{
Expand Down
10 changes: 5 additions & 5 deletions images/src/generate.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import OpenAI from 'openai'
import * as gptscript from '@gptscript-ai/gptscript'
import axios from 'axios'
import { createHash } from 'node:crypto'
import OpenAI from "openai"
import * as gptscript from "@gptscript-ai/gptscript"
import axios from "axios"
import {createHash} from "node:crypto"

type ImageSize = '1024x1024' | '256x256' | '512x512' | '1792x1024' | '1024x1792';
type ImageQuality = 'standard' | 'hd';
Expand Down Expand Up @@ -36,7 +36,7 @@ export async function generateImages(

try {
const response = await openai.images.generate({
model: 'dall-e-3',
model: process.env.OTTO8_DEFAULT_IMAGE_GENERATION_MODEL ?? 'dall-e-3',
prompt,
size: size as ImageSize,
quality: quality as ImageQuality,
Expand Down