@axflow/models
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -35,3 +35,3 @@ "use strict"; | ||
const history = messagesRef.current; | ||
const requestBody = typeof body === "function" ? body(message, history) : { ...body, message, history }; | ||
const requestBody = typeof body === "function" ? body(message, history) : { ...body, messages: history.concat(message) }; | ||
setMessages(messagesRef.current.concat(message)); | ||
@@ -38,0 +38,0 @@ const response = await (0, import_shared.POST)(url, { |
{ | ||
"name": "@axflow/models", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Zero-dependency, modular SDK for building robust natural language applications", | ||
@@ -150,3 +150,3 @@ "author": "Axilla (https://axilla.io)", | ||
}, | ||
"gitHead": "ed0841b5dd94e4f89b38505a7daacbf4d2c00899" | ||
"gitHead": "448506fd42200f1f6212fc2abefa4e6635cb3108" | ||
} |
106
README.md
@@ -28,8 +28,17 @@ # @axflow/models | ||
## Guides | ||
## Documentation | ||
See the guides at [docs.axilla.io](https://docs.axilla.io/guides.html). | ||
View the [Guides](https://docs.axflow.dev/guides) or the reference: | ||
## Basic Usage | ||
* [@axflow/models/openai/chat](https://docs.axflow.dev/documentation/models/openai-chat) | ||
* [@axflow/models/openai/completion](https://docs.axflow.dev/documentation/models/openai-completion) | ||
* [@axflow/models/openai/embedding](https://docs.axflow.dev/documentation/models/openai-embedding) | ||
* [@axflow/models/anthropic/completion](https://docs.axflow.dev/documentation/models/anthropic-completion) | ||
* [@axflow/models/cohere/generation](https://docs.axflow.dev/documentation/models/cohere-generation) | ||
* [@axflow/models/cohere/embedding](https://docs.axflow.dev/documentation/models/cohere-embedding) | ||
* [@axflow/models/react](https://docs.axflow.dev/documentation/models/react) | ||
* [@axflow/models/shared](https://docs.axflow.dev/documentation/models/shared) | ||
## Example Usage | ||
```ts | ||
@@ -190,92 +199,1 @@ import {OpenAIChat} from '@axflow/models/openai/chat'; | ||
``` | ||
## API | ||
### @axflow/models/openai/chat | ||
```ts | ||
import {OpenAIChat} from '@axflow/models/openai/chat'; | ||
import type {OpenAIChatTypes} from '@axflow/models/openai/chat'; | ||
OpenAIChat.run(/* args */) | ||
OpenAIChat.stream(/* args */) | ||
OpenAIChat.streamBytes(/* args */) | ||
OpenAIChat.streamTokens(/* args */) | ||
``` | ||
### @axflow/models/openai/completion | ||
```ts | ||
import {OpenAICompletion} from '@axflow/models/openai/completion'; | ||
import type {OpenAICompletionTypes} from '@axflow/models/openai/completion'; | ||
OpenAICompletion.run(/* args */) | ||
OpenAICompletion.stream(/* args */) | ||
OpenAICompletion.streamBytes(/* args */) | ||
OpenAICompletion.streamTokens(/* args */) | ||
``` | ||
### @axflow/models/openai/embedding | ||
```ts | ||
import {OpenAIEmbedding} from '@axflow/models/openai/embedding'; | ||
import type {OpenAIEmbeddingTypes} from '@axflow/models/openai/embedding'; | ||
OpenAIEmbedding.run(/* args */) | ||
``` | ||
### @axflow/models/cohere/generation | ||
```ts | ||
import {CohereGeneration} from '@axflow/models/cohere/generation'; | ||
import type {CohereGenerationTypes} from '@axflow/models/cohere/generation'; | ||
CohereGeneration.run(/* args */) | ||
CohereGeneration.stream(/* args */) | ||
CohereGeneration.streamBytes(/* args */) | ||
CohereGeneration.streamTokens(/* args */) | ||
``` | ||
### @axflow/models/cohere/embedding | ||
```ts | ||
import {CohereEmbedding} from '@axflow/models/cohere/embedding'; | ||
import type {CohereEmbeddingTypes} from '@axflow/models/cohere/embedding'; | ||
CohereEmbedding.run(/* args */) | ||
``` | ||
### @axflow/models/anthropic/completion | ||
```ts | ||
import {AnthropicCompletion} from '@axflow/models/anthropic/completion'; | ||
import type {AnthropicCompletionTypes} from '@axflow/models/anthropic/completion'; | ||
AnthropicCompletion.run(/* args */) | ||
AnthropicCompletion.stream(/* args */) | ||
AnthropicCompletion.streamBytes(/* args */) | ||
AnthropicCompletion.streamTokens(/* args */) | ||
``` | ||
### @axflow/models/react | ||
```ts | ||
import {useChat} from '@axflow/models/react'; | ||
import type {UseChatOptionsType, UseChatResultType} from '@axflow/models/shared'; | ||
``` | ||
`useChat` is a react hook that makes building chat componets a breeze. | ||
### @axflow/models/shared | ||
```ts | ||
import { | ||
IterableToStream, | ||
StreamToIterable, | ||
NdJsonStream, | ||
StreamingJsonResponse, | ||
HttpError, | ||
isHttpError | ||
} from '@axflow/models/shared'; | ||
import type {NdJsonValueType, JSONValueType, MessageType} from '@axflow/models/shared'; | ||
``` |
Sorry, the diff of this file is not supported yet
136713
198