Skip to content

Commit

Permalink
Update docs (#1)
Browse files Browse the repository at this point in the history
* update README

* Update package.json
  • Loading branch information
extremeheat authored Feb 18, 2024
1 parent 72c93db commit 3db68bd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 34 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
[![Build Status](https://github.com/extremeheat/LXL/actions/workflows/ci.yml/badge.svg)](https://github.com/extremeheat/LXL/actions/workflows/)
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/extremeheat/LXL)

LangXLang (LXL), a simple wrapper for Node.js and OpenAI's GPT and Google PaLM 2 LLMs.
LangXLang (LXL), a simple wrapper for Node.js to use OpenAI's GPT models and Google's Gemini and PaLM 2 models.

Supported models are:
* OpenAI: `gpt-3.5-turbo-16k`, `gpt-3.5-turbo`, `gpt-4`, `gpt-4-turbo-preview`
* Google: `gemini-1.0-pro` (Gemini), or `text-bison-001`, `text-bison-002`, `palm-2` (PaLM 2)

Work in progress, not ready for use.

Expand All @@ -19,22 +23,22 @@ See tests/ for examples.

## API

### `CompletionService`
### CompletionService

#### `constructor(apiKeys: { openai: string, gemini: string })`
#### constructor(apiKeys: { openai: string, gemini: string })

Creates an instance of completion service.
Note: as an alternative to explicitly passing the API keys in the constructor you can:
* set the `OPENAI_API_KEY` and `GEMINI_API_KEY` environment variables.
* or, define the keys inside `/.local/share/lxl-cache.json` (linux), `~/Library/Application Support/lxl-cache.json` (mac), or `%appdata%\lxl-cache.json` (windows).

#### async `requestCompletion(model: string, systemPrompt: string, userPrompt: string)`
#### async requestCompletion(model: string, systemPrompt: string, userPrompt: string)

Request a non-streaming completion from the model.

### `ChatSession`
### ChatSession

### `constructor(completionService: CompletionService, model: string, systemPrompt: string)`
### constructor(completionService: CompletionService, model: string, systemPrompt: string)

ChatSession is for back and forth conversation between a user an an LLM.

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "langxlang",
"version": "0.1.0",
"description": "OpenAI GPT and Google PaLM 2 LLM wrapper",
"description": "LLM wrapper for OpenAI GPT and Google Gemini and PaLM 2 models",
"main": "src/index.js",
"types": "src/index.d.ts",
"scripts": {
"test": "",
"pretest": "npm run lint",
Expand All @@ -13,7 +14,7 @@
"type": "git",
"url": "git+https://github.com/extremeheat/LXL.git"
},
"keywords": [],
"keywords": ["gpt", "openai", "gemini", "palm", "chat", "ai", "ml"],
"author": "extremeheat",
"license": "MIT",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion test/basic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

describe('basic', () => {
it('test', () => {
console.log('it works~')
console.log('please manually run test in api.js')
})
})
25 changes: 0 additions & 25 deletions test/openai.js

This file was deleted.

0 comments on commit 3db68bd

Please sign in to comment.