GaiaNet-AI / docs

Apache License 2.0
8 stars 8 forks source link

added Node example to the /user-guide/apps/intro page #55

Closed harishkotra closed 3 months ago

harishkotra commented 3 months ago

Added an additional example using node in the OpenAI ecosystem apps page.

This example addition demonstrates how to set up and use the OpenAI API with a custom base URL, enabling integration with alternative AI providers or private deployments in a Node.js project.

juntao commented 3 months ago

Hello, I am a PR summary agent on flows.network. Here are my reviews of code commits in this PR.


Commit b3a612aa63b3f879dc742e5b8d929666b4ec27ac

Key changes:

  1. The OpenAI Node API library has been added as a guide for JavaScript/TypeScript developers.
  2. It provides a convenient way to access the OpenAI REST API, with installation instructions and code examples given.
  3. Users are instructed to create an OpenAI client with a custom base URL that points to their Gaia node's address, which should have /v1 appended after the host name.
  4. The API key is not necessary when using Gaia, so it can be left empty.
  5. A new function, callOpenAI(), has been introduced as an example of how to make API calls from the client, with a specific model ("Meta-Llama-3-8B-Instruct-Q5_K_M") being used in this case.
harishkotra commented 3 months ago

@alabulei1 for your review. Thank you.