Skip to content

Commit

Permalink
fix exports and readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
atinylittleshell committed Aug 20, 2023
1 parent 9bfddca commit 33d02dd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-seahorses-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'function-gpt': patch
---

fix exports and readme example
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
[![codecov](https://codecov.io/gh/atinylittleshell/function-gpt/graph/badge.svg?token=1R81CX1Z14)](https://codecov.io/gh/atinylittleshell/function-gpt)
[![MIT License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/atinylittleshell/function-gpt/blob/main/license)

- Requires typescript
- Leverages the official [openai](https://www.npmjs.com/package/openai) npm package for communicating with OpenAI's API
- Automatically generate function calling JSON schema from decorated typescript classes
- Uses typescript decorators to provide metadata for function calling
- Automatically generate function calling JSON schema from decorated typescript functions
- Automatically parse function calling response
- Automatically call functions and send back results to OpenAI

## Example

```typescript
import { gptFunction, gptObjectField, ChatGPTSession } from 'function-gpt';

// First create your own class that extends ChatGPTSession.
class BrowseSession extends ChatGPTSession {
// Define functions that you want to provide to ChatGPT for function calling.
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"function calling"
],
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"import": {
"default": "./dist/index.js",
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"require": {
"default": "./dist/index.cjs",
"types": "./dist/index.d.cts"
}
},
"files": [
Expand Down

0 comments on commit 33d02dd

Please sign in to comment.