Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add contact page, improve tables and examples #56

Merged
merged 1 commit into from
Jul 13, 2024
Merged

Conversation

sam-goldman
Copy link
Contributor

@sam-goldman sam-goldman commented Jul 12, 2024

  • token.js -> Token.js
  • Updates the examples in the Gitbook in two ways:
    • Defines the messages array in the create function instead of assigning it to a variable because there's currently a TypeScript type error when messages is assigned to a variable
    • Wraps the async calls in a main function so that users can copy and paste the example into a file and run it as is
  • Updates the feature compatibility charts to include a symbol for features not supported by the LLM provider. Also, adds a legend below the charts to explain what the symbols mean. (Without this, I'm concerned readers won't know whether a given feature is unsupported by the provider or unsupported by just Token.js).
  • Includes a link to get an API key in each provider docs page.
  • Removes the Usage section from the GitHub README, and instead redirect the user to our GitBook. I was lazy and didn't want to make the changes to the GitHub README after updating the GitBook README.
  • Adds a "Contact Us" section with a Discord, Calendly, phone number, and email. I didn't add the Discord link, but the rest are set up.
  • Minor language edits (style, conciseness, grammar, etc)

@sam-goldman sam-goldman force-pushed the sg/gitbook branch 3 times, most recently from b691a32 to db6af59 Compare July 13, 2024 18:11
@sam-goldman sam-goldman changed the title a docs: add contact page, improve tables and examples Jul 13, 2024
@sam-goldman sam-goldman requested a review from RPate97 July 13, 2024 18:40
Copy link
Contributor

@RPate97 RPate97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very opinionated on the main readme, see my comment. Also I don't think we should be opinionated on the use of dotenv to load the environment variables because in most situations it doesn't make sense to use.

README.md Outdated Show resolved Hide resolved
docs/contact-us.md Show resolved Hide resolved
Comment on lines -18 to -29
const messages: ChatCompletionMessageParam = [{
role: 'user',
content: `How are you?`,
}]

// Call the create function
const result = await tokenjs.chat.completions.create({
// Specify the target model and provider
provider: 'ai21',
model: 'jamba-instruct',
messages,
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not cause a type error, at least not for me.
Screenshot 2024-07-13 at 12 04 36 PM

Copy link
Contributor

@RPate97 RPate97 Jul 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of defining the messages array separately was to demonstrate the use of types and that you can import the types from our package which is a nice quality of life thing IMO.

I'm not super opinionated on this, but I do think removing it makes the example slightly worse.

Copy link
Contributor Author

@sam-goldman sam-goldman Jul 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very opinionated on this either, but I'm still getting a type error, so I don't think we should consider including it in the example until that's resolved. I opened an issue for it here: #67

Want me to create a separate ticket for adding the ChatCompletionsMessageParam type back to the documentation examples?

docs/providers/ai21.md Show resolved Hide resolved
src/handlers/base.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@RPate97 RPate97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I would bring back the message types but I'm not so opinionated as to block the PR on it.

@sam-goldman sam-goldman merged commit 1fb48f3 into main Jul 13, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants