Skip to content

Commit

Permalink
Add TSConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
tedspare committed Oct 9, 2024
1 parent 78834be commit f0c568c
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- [2024-10-09] [Add TSConfig](https://github.com/RubricLab/memory/commit/ed521824cc492e46adff6d38a994e18cc08166b2)
- [2024-10-09] [Extract memory to class](https://github.com/RubricLab/memory/commit/5e165608ffad822c5b77ee03f1dfc308dcb1787a)
- [2024-10-09] [Fix precision calc](https://github.com/RubricLab/memory/commit/52fc41e151c47e276c37a24b3489ba414d032a0b)
- [2024-10-09] [Generalize eval arch](https://github.com/RubricLab/memory/commit/bf80487850e840525a1521925a439d7d9fc8d638)
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@rubriclab/memory",
"module": "index.ts",
"version": "0.0.8",
"module": "src/index.ts",
"version": "0.0.9",
"private": false,
"type": "module",
"devDependencies": {
Expand Down Expand Up @@ -30,7 +30,7 @@
"bleed": "bun x npm-check-updates -u",
"clean": "rm -rf .next && rm -rf node_modules",
"format": "bun x biome format --write .",
"eval": "bun evals/index.ts",
"eval": "bun src/evals/index.ts",
"lint": "bun x biome check . && bun x biome lint .",
"lint:fix": "bun x biome check --fix --unsafe . && bun x biome lint --write --unsafe ."
}
Expand Down
4 changes: 2 additions & 2 deletions evals/index.ts → src/evals/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { parseArgs } from 'node:util'
import { runOneShotExamples } from './one-shot'
import { runMultiTurnExamples } from './multi-turn'
import { runMultiTurnExamples } from '@/evals/multi-turn'
import { runOneShotExamples } from '@/evals/one-shot'

const args = parseArgs({
args: Bun.argv,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
type Fact = {
subject: string
relation: string
object: string
data?: Record<string, string>
}
import type { Fact } from '@/types'

type Example = {
content: string
Expand Down
6 changes: 3 additions & 3 deletions evals/one-shot/index.ts → src/evals/one-shot/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Memory } from '@/'
import { format } from '@/utils/string'
import type { openai } from '@ai-sdk/openai'
import chalk from 'chalk'
import { Memory } from '../../index.ts'
import { format } from '../../utils/string.ts'
import { EXAMPLES } from './examples.ts'
import { EXAMPLES } from './examples'

export const runOneShotExamples = async ({ model }: { model: Parameters<typeof openai>[0] }) => {
let totalFacts = 0
Expand Down
2 changes: 1 addition & 1 deletion index.ts → src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { clean } from '@/utils/string'
import { openai } from '@ai-sdk/openai'
import { generateObject } from 'ai'
import { z } from 'zod'
import { clean } from './utils/string'

export class Memory {
model: Parameters<typeof openai>[0]
Expand Down
2 changes: 1 addition & 1 deletion tests/index.test.ts → src/tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from 'bun:test'
import { memory } from '../'
import { memory } from '@'

test('exports a function', () => {
expect(typeof memory).toBe('function')
Expand Down
6 changes: 6 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export type Fact = {
subject: string
relation: string
object: string
data?: Record<string, string>
}
File renamed without changes.
10 changes: 10 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"exclude": ["node_modules"],
"extends": "@rubriclab/config/tsconfig"
}

0 comments on commit f0c568c

Please sign in to comment.