Skip to content

Commit

Permalink
feat: added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xcadams committed Jul 29, 2023
1 parent 5a95ebc commit 69b2ecd
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 8 deletions.
4 changes: 3 additions & 1 deletion docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export default withTwoslash(
// apiKey: '',
// indexName: 'hopfield',
// },
search: {
provider: 'local',
},
editLink: {
pattern: 'https://github.com/propology/hopfield/edit/main/docs/:path',
text: 'Suggest changes to this page',
Expand Down Expand Up @@ -168,7 +171,6 @@ export default withTwoslash(
title:
'Hopfield: Typescript-first LLM framework with static type inference, testability, and composability.',
twoslash: {
addTryButton: true,
defaultCompilerOptions: {
target: ScriptTarget.ESNext,
},
Expand Down
16 changes: 14 additions & 2 deletions docs/chat/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ All of these checks are entirely customizable and can be disabled with the `opti

You can then use the `HopfieldFunction` with OpenAI:

::: info
This is under construction.
### Roadmap

We have more plans for the features we build for function calling.

1. **Streaming arguments validation:** we are working on adding support for validating the arguments which are
streamed back from a provider. Currently, streaming responses are not fully validated against the input schema,
due to receiving the content in chunks.

::: info Feedback

To influence these features, reach out on [Discord](https://discord.gg/2hag5fc6) or
[Github Discussions](https://github.com/propology/hopfield/discussions).
We want your feedback!

:::
6 changes: 3 additions & 3 deletions docs/chat/streaming.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ API providers with type guarantees with Zod.
Use streaming chat models from OpenAI with a few lines of code:

```ts twoslash
const takeAction = (message: string) => {};
const takeAction = async (message: string) => {};
// ---cut---
import hop from "hopfield";
import openai from "hopfield/openai";
Expand Down Expand Up @@ -42,8 +42,8 @@ for await (const part of response) {
if (part.choices[0].__type === "content") {
// ^?
// action based on the delta for the streaming message content
takeAction(part.choices[0].delta.content);
// ^?
await takeAction(part.choices[0].delta.content);
// ^?

parts.push(part);
}
Expand Down
2 changes: 1 addition & 1 deletion docs/embeddings/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: "Embeddings - Overview"
Hopfield provides an easy way to get type-safe embeddings. You can use different API providers with type
guarantees with Zod, and composability across providers.

::: info
::: info API Providers

We currently only support OpenAI, but are
working on adding further providers. Reach out on [Discord](https://discord.gg/2hag5fc6) or
Expand Down
26 changes: 25 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ title: "Hopfield: Typescript-first LLM framework with static type inference, tes
titleTemplate: false
---

<script setup>
import {
VPTeamMembers
} from 'vitepress/theme'

const members = [
{
avatar: 'https://avatars.githubusercontent.com/u/32714304?v=4',
name: 'Chase Adams',
title: 'Creator',
links: [
{ icon: 'github', link: 'https://github.com/0xcadams' },
{ icon: 'twitter', link: 'https://twitter.com/0xcadams' }
]
}
]
</script>

<p align="center" style="min-height:60px;width:100%;">
<img img-dark alt="Hopfield" src="/hopfield-w-text.png" height="60" style="width:auto;">
<img img-light alt="Hopfield" src="/hopfield-white-w-text.png" height="60" style="width:auto;">
Expand Down Expand Up @@ -247,10 +265,16 @@ Oh, and liking Typescript is a nice-to-have.
If you have questions or need help, reach out to the community at the [Hopfield GitHub Discussions](https://github.com/propology/hopfield/discussions)
or join the [Propology Discord](https://discord.gg/2hag5fc6) and check out the `🐇-hopfield` channel.

## Learn More
<div align="center" style="width:100%;">
<VPTeamMembers :members="members" />
</div>

## Learn more

Read the [Getting Started](/guide/getting-started) guide to learn more how to use Hopfield.

### Inspiration

Shoutout to these projects which inspired us:

- [Zod](https://github.com/colinhacks/zod)
Expand Down

0 comments on commit 69b2ecd

Please sign in to comment.