Skip to content

custom chatgpt integration in mdbook #2

Description

@despiegk
import openai

openai.api_key = 'your-api-key'

response = openai.Completion.create(
  model="your-custom-model-name",  # Replace with your custom model name
  prompt="Your prompt here",
  max_tokens=100
)

print(response.choices[0].text)

example as created by openai

  • we need a python server with simple rest interface
  • this python server queries more than 1 custom chatgpt
  • we embed a chat widget in mdbook
  • this chat widget queries the python server and lets people interact with the custom chat gpt
  • prepromt the chat gpt to answer mainly from the info provided

our aim is to allow people to talk to our mdbooks. we will feed a pdf text only with links into chatgpt

can we make the example code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions