-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
craeting more experiments and created dashboard
- Loading branch information
Showing
11 changed files
with
585 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
.app { | ||
max-width: 800px; | ||
padding: 20px; | ||
max-width: 1000px; | ||
margin: 0 auto; | ||
padding: 2rem; | ||
} | ||
|
||
.controls { | ||
margin: 2rem 0; | ||
margin: 20px 0; | ||
} | ||
|
||
.graph { | ||
background: white; | ||
padding: 20px; | ||
border-radius: 8px; | ||
box-shadow: 0 2px 4px rgba(0,0,0,0.1); | ||
} | ||
|
||
select { | ||
margin-left: 1rem; | ||
padding: 0.5rem; | ||
font-size: 1rem; | ||
padding: 8px; | ||
margin-left: 10px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import 'dotenv/config' | ||
import { runLLM } from '../../src/llm' | ||
import { redditToolDefinition } from '../../src/tools/reddit' | ||
import { dadJokeToolDefinition } from '../../src/tools/dadJoke' | ||
import { generateImageToolDefinition } from '../../src/tools/generateImage' | ||
import { runEval } from '../lib/evalTools' | ||
import { ToolCallMatch } from '../lib/scorers' | ||
|
||
const createToolCallMessage = (toolName: string) => ({ | ||
role: 'assistant' as const, | ||
content: null, | ||
tool_calls: [ | ||
{ | ||
id: 'test-id', | ||
type: 'function' as const, | ||
function: { | ||
name: toolName, | ||
arguments: '{}' | ||
}, | ||
}, | ||
], | ||
}) | ||
|
||
export const allToolsEval = () => runEval('allTools', { | ||
task: (input) => | ||
runLLM({ | ||
messages: [{ role: 'user', content: input }], | ||
tools: [redditToolDefinition, dadJokeToolDefinition, generateImageToolDefinition], | ||
}), | ||
data: [ | ||
{ | ||
input: 'find me something interesting on reddit', | ||
expected: createToolCallMessage(redditToolDefinition.function.name), | ||
}, | ||
{ | ||
input: 'tell me a dad joke', | ||
expected: createToolCallMessage(dadJokeToolDefinition.function.name), | ||
}, | ||
{ | ||
input: 'generate an image of a sunset', | ||
expected: createToolCallMessage(generateImageToolDefinition.function.name), | ||
}, | ||
], | ||
scorers: [ToolCallMatch], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import 'dotenv/config' | ||
|
||
import { runLLM } from '../../src/llm' | ||
import { dadJokeToolDefinition } from '../../src/tools/dadJoke' | ||
import { runEval } from '../evalTools' | ||
import { ToolCallMatch } from '../scorers' | ||
|
||
const createToolCallMessage = (toolName: string) => ({ | ||
role: 'assistant' as const, | ||
content: null, | ||
tool_calls: [ | ||
{ | ||
id: 'test-id', | ||
type: 'function' as const, | ||
function: { | ||
name: toolName, | ||
arguments: '{}' | ||
}, | ||
}, | ||
], | ||
}) | ||
|
||
export const dadJokeEval = () => runEval('dadJoke', { | ||
task: (input) => | ||
runLLM({ | ||
messages: [{ role: 'user', content: input }], | ||
tools: [dadJokeToolDefinition], | ||
}), | ||
data: [ | ||
{ | ||
input: 'Tell me a funny dad joke', | ||
expected: createToolCallMessage(dadJokeToolDefinition.function.name), | ||
}, | ||
], | ||
scorers: [ToolCallMatch], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import 'dotenv/config' | ||
|
||
import { runLLM } from '../../src/llm' | ||
import { generateImageToolDefinition } from '../../src/tools/generateImage' | ||
import { runEval } from '../lib/evalTools' | ||
import { ToolCallMatch } from '../lib/scorers' | ||
|
||
const createToolCallMessage = (toolName: string) => ({ | ||
role: 'assistant' as const, | ||
content: null, | ||
tool_calls: [ | ||
{ | ||
id: 'test-id', | ||
type: 'function' as const, | ||
function: { | ||
name: toolName, | ||
arguments: '{}' | ||
}, | ||
}, | ||
], | ||
}) | ||
|
||
export const generateImageEval = () => runEval('generateImage', { | ||
task: (input) => | ||
runLLM({ | ||
messages: [{ role: 'user', content: input }], | ||
tools: [generateImageToolDefinition], | ||
}), | ||
data: [ | ||
{ | ||
input: 'Generate an image of a sunset', | ||
expected: createToolCallMessage(generateImageToolDefinition.function.name), | ||
}, | ||
{ | ||
input: 'take a photo of the sunset', | ||
expected: createToolCallMessage(generateImageToolDefinition.function.name), | ||
}, | ||
], | ||
scorers: [ToolCallMatch], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.