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

custom chatgpt integration in mdbook #2

Open
despiegk opened this issue Nov 13, 2023 · 0 comments
Open

custom chatgpt integration in mdbook #2

despiegk opened this issue Nov 13, 2023 · 0 comments

Comments

@despiegk
Copy link
Owner

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

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

No branches or pull requests

1 participant