Skip to content

Commit

Permalink
Added Missing Types (#8)
Browse files Browse the repository at this point in the history
* fix: added missing types

* fix: fixed types

* feat: added vitepress fixes
  • Loading branch information
0xcadams committed Sep 29, 2023
1 parent 9128b23 commit 24b5bdc
Show file tree
Hide file tree
Showing 13 changed files with 350 additions and 297 deletions.
5 changes: 5 additions & 0 deletions .changeset/sixty-jobs-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hopfield": patch
---

**Fix:** fixed some missing types to be explicit.
7 changes: 7 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { defineConfig } from 'vitepress';
import { withTwoslash } from 'vitepress-plugin-shiki-twoslash';

import { version } from '../../package.json';
import pkg from 'typescript';
const { ScriptTarget } = pkg;

export default withTwoslash(
defineConfig({
Expand Down Expand Up @@ -165,6 +167,11 @@ export default withTwoslash(
},
title:
'Hopfield: Typescript-first LLM framework with static type inference, testability, and composability.',
twoslash: {
defaultCompilerOptions: {
target: ScriptTarget.ESNext,
},
},
vue: {
template: {
compilerOptions: {
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

:root {
--vp-c-accent: hsl(39, 90%, 49.8%);
--vp-c-brand: hsl(39, 90%, 49.8%);
--vp-c-brand-1: hsl(39, 90%, 49.8%);
--vp-c-brand-light: hsl(31, 91%, 67%);
--vp-c-brand-lighter: hsl(32, 91%, 73%);
--vp-c-brand-dark: hsl(30, 75%, 34%);
Expand Down
17 changes: 17 additions & 0 deletions docs/guide/comparisons.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ No other library does what Hopfield does (inferring static LLM TypeScript types

Comparisons strive to be as accurate and as unbiased as possible. If you use any of these libraries and feel the information could be improved, feel free to suggest changes.

## `ai`

[**`ai`**](https://github.com/vercel/ai) is a framework for AI-powered applications with React, Svelte, Vue, and Solid. They provide hooks to easily integrate
with a streaming text response (`StreamingTextResponse`) and allow a callback for function calling, as well as simple, drop-in components for React and other
frameworks.

**Hopfield** provides a subset of these features, and focuses solely on the API interactions, and **not** on providing React components.

Below is a comparison of the library features:

| | **`ai`** | **Hopfield** |
| ---------------------- | ----------------------------------------- | ---------------------------------------------- |
| **React Components** | Easy, inflexible UI components & hooks | No UI components or hooks |
| **Typed Functions** | Streaming function calls with loose types | Strict function call types with Zod validation |
| **Framework Examples** | Multiple | Multiple |
| **Chat Providers** | Multiple | OpenAI, with support for others coming |

## Langchain.js

[**Langchain.js**](https://github.com/hwchase17/langchainjs) is a framework for developing applications powered by language models
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"serve": "vitepress serve"
},
"devDependencies": {
"@types/markdown-it-footnote": "^3.0.0",
"@types/markdown-it-footnote": "^3.0.1",
"hopfield": "workspace:*",
"markdown-it-footnote": "^3.0.3",
"vitepress": "1.0.0-rc.10",
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,22 @@
"devDependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"@types/fs-extra": "^11.0.1",
"@types/json-schema": "^7.0.12",
"@types/node": "20.5.7",
"@vitest/coverage-v8": "^0.34.3",
"@types/fs-extra": "^11.0.2",
"@types/json-schema": "^7.0.13",
"@types/node": "20.7.2",
"@vitest/coverage-v8": "^0.34.6",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"bun": "^0.8.1",
"bun": "^1.0.3",
"fs-extra": "^11.1.1",
"json-schema": "^0.4.0",
"json-schema-deref-sync": "^0.14.0",
"openai": "4.3.1",
"rimraf": "^5.0.1",
"openai": "4.11.0",
"rimraf": "^5.0.5",
"rome": "^12.1.3",
"simple-git-hooks": "^2.9.0",
"typescript": "5.2.2",
"vitest": "^0.34.3",
"vitest": "^0.34.6",
"zod": "^3.22.2"
},
"simple-git-hooks": {
Expand Down

0 comments on commit 24b5bdc

Please sign in to comment.