kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
feat: improve basic readme for local dev
rodzic
80cd6a11bc
commit
3199d4a79b
|
@ -6,3 +6,6 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
OPENAI_API_KEY=
|
||||
|
||||
# required for running tests
|
||||
#REDIS_URL_TEST=
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
"ky": "^0.33.3",
|
||||
"openai-fetch": "^1.5.0",
|
||||
"p-map": "^6.0.0",
|
||||
"p-timeout": "^6.1.1",
|
||||
"quick-lru": "^6.1.1",
|
||||
"ts-dedent": "^2.2.0",
|
||||
"zod": "^3.21.4",
|
||||
|
|
|
@ -19,6 +19,9 @@ dependencies:
|
|||
p-map:
|
||||
specifier: ^6.0.0
|
||||
version: 6.0.0
|
||||
p-timeout:
|
||||
specifier: ^6.1.1
|
||||
version: 6.1.1
|
||||
quick-lru:
|
||||
specifier: ^6.1.1
|
||||
version: 6.1.1
|
||||
|
@ -2378,6 +2381,11 @@ packages:
|
|||
engines: {node: '>=12'}
|
||||
dev: true
|
||||
|
||||
/p-timeout@6.1.1:
|
||||
resolution: {integrity: sha512-yqz2Wi4fiFRpMmK0L2pGAU49naSUaP23fFIQL2Y6YT+qDGPoFwpvgQM/wzc6F8JoenUkIlAFa4Ql7NguXBxI7w==}
|
||||
engines: {node: '>=14.16'}
|
||||
dev: false
|
||||
|
||||
/parse-json@4.0.0:
|
||||
resolution: {integrity: sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==}
|
||||
engines: {node: '>=4'}
|
||||
|
|
69
readme.md
69
readme.md
|
@ -5,59 +5,56 @@
|
|||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/agentic"><img alt="agentic NPM package" src="https://img.shields.io/npm/v/agentic.svg" /></a>
|
||||
<a href="https://www.npmjs.com/package/@agentic/core"><img alt="@agentic/core npm package" src="https://img.shields.io/npm/v/@agentic/core.svg" /></a>
|
||||
<a href="https://github.com/transitive-bullshit/agentic/actions/workflows/test.yml"><img alt="Build Status" src="https://github.com/transitive-bullshit/agentic/actions/workflows/test.yml/badge.svg" /></a>
|
||||
<a href="https://github.com/transitive-bullshit/agentic/blob/main/license"><img alt="MIT License" src="https://img.shields.io/badge/license-MIT-blue" /></a>
|
||||
<a href="https://prettier.io"><img alt="Prettier Code Formatting" src="https://img.shields.io/badge/code_style-prettier-brightgreen.svg" /></a>
|
||||
</p>
|
||||
|
||||
- [Intro](#intro)
|
||||
- [Development](#development)
|
||||
- [Environment](#environment)
|
||||
- [Local Testing](#local-testing)
|
||||
- [License](#license)
|
||||
|
||||
## Intro
|
||||
|
||||
TODO
|
||||
|
||||
## TODO
|
||||
## Development
|
||||
|
||||
https://github.com/colinhacks/zod#writing-generic-functions
|
||||
- [node](https://nodejs.org/en) >= 18
|
||||
- [pnpm](https://pnpm.io) >= 8
|
||||
|
||||
## Use Cases
|
||||
```bash
|
||||
pnpm install
|
||||
```
|
||||
|
||||
https://platform.openai.com/examples
|
||||
### Environment
|
||||
|
||||
- text completion
|
||||
- text generation
|
||||
- text classification
|
||||
- https://platform.openai.com/docs/guides/completion/classification
|
||||
- https://docs.cohere.com/docs/text-classification-with-classify
|
||||
- special cases
|
||||
- content moderation
|
||||
- https://platform.openai.com/docs/guides/moderation/overview
|
||||
- language detection
|
||||
- conversation
|
||||
- transformation
|
||||
- translation
|
||||
- conversion
|
||||
- summarization
|
||||
- completion
|
||||
- factual responses
|
||||
- chat completion
|
||||
- entity extraction
|
||||
- reranking
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
// take in a query and a list of texts and produces an ordered array with each text assigned a relevance score.
|
||||
// generate JSON conforming to a zod schema
|
||||
// generate a string conforming to a zod schema
|
||||
// generate TS code and ensure it is valid syntax + valid exports
|
||||
// generate HTML and ensure it parses correctly
|
||||
// primitives (boolean, number, z.coerce.date, string)
|
||||
// classifier (enum)
|
||||
// CSV
|
||||
**Required**
|
||||
|
||||
// retry strategies
|
||||
- `OPENAI_API_KEY` - OpenAI API key.
|
||||
- `REDIS_URL_TEST` - Redis server URL used for caching third-party API calls during testing.
|
||||
|
||||
// separate the prompt formatting from the inference call?
|
||||
**Optional**
|
||||
|
||||
- `ANTHROPIC_API_KEY` - [Anthropic](https://www.anthropic.com) API key ([docs](https://console.anthropic.com/docs))
|
||||
- `SERP_API_KEY` - [SerpApi](https://serpapi.com) API key ([docs](https://serpapi.com/search-api))
|
||||
- `METAPHOR_API_KEY` - [Metaphor](https://metaphor.systems) API key ([docs](https://metaphorapi.readme.io/))
|
||||
|
||||
### Local Testing
|
||||
|
||||
Ensure you have `REDIS_URL_TEST` set to a valid redis connection URL.
|
||||
|
||||
```bash
|
||||
pnpm test
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Travis Fischer](https://transitivebullsh.it)
|
||||
|
||||
If you found this project interesting, please consider [sponsoring me](https://github.com/sponsors/transitive-bullshit) or <a href="https://twitter.com/transitive_bs">following me on twitter <img src="https://storage.googleapis.com/saasify-assets/twitter-logo.svg" alt="twitter" height="24px" align="center"></a>
|
||||
|
|
|
@ -63,7 +63,7 @@ test('OpenAIChatModel ⇒ json output', async (t) => {
|
|||
expectTypeOf(result).toMatchTypeOf<{ foo: string; bar: number }>()
|
||||
})
|
||||
|
||||
test.only('OpenAIChatModel ⇒ boolean output', async (t) => {
|
||||
test('OpenAIChatModel ⇒ boolean output', async (t) => {
|
||||
t.timeout(2 * 60 * 1000)
|
||||
const client = createOpenAITestClient()
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue