Git Product home page Git Product logo

chat-gpt-ppt's Introduction

chat-gpt-ppt

Use ChatGPT to generate PPT automatically, all in one single file.

Showcase

  1. Some topics for presentation named topic.txt:
what's OpenAI?
how OpenAI works?
what is the future of OpenAI?
  1. Save your openai token to token.txt.
  2. Generate a ppt in seconds:
./cgp

And you get one:

With multi languages support:

Or different render engine:

Usage

You can download prebuild binaries from release page.

  1. Download a executable binary
  2. Add your topics to topic.txt
  3. Add your token (official openai api key, with no extra white space, no empty line) to token.txt
  4. run ./cgp

Everything done. You can get some help about command line arguments with cgp --help.

$ ./cgp_macos --help
Usage of ./cgp_macos:
  -client string
        gpt client type (default "GPT35")
  -output string
        out path (default "./output.html")
  -renderer string
        renderer type (default "REMARK")
  -rendererBin string
        binary file for renderer
  -token string
        token file path (default "./token.txt")
  -topic string
        topic file path (default "./topic.txt")

Interactive mode

-i flag allows you checking and correcting generated contents one by one.

@williamfzc ➜ /workspaces/chat-gpt-ppt (main) $ ./cgp -i
start preparing ...
start generating ...
2023/03/18 08:17:23 topic what's OpenAI? done 
Here is your response, type any key to continue, type 'n' to edit 
# what's OpenAI?



- OpenAI is an artificial intelligence research lab.
- It was founded by a group of well-known tech industry figures in 2015 as a non-profit organization.
- OpenAI's mission is to ensure that AGI (Artificial General Intelligence) benefits all of humanity.
- Their research covers many areas of AI, such as reinforcement learning, natural language processing, computer vision, and robotics.
- OpenAI also develops and releases several powerful AI-based tools, including GPT-3, which has revolutionized natural language processing.

>>>  

Contribution

Thanks for your interest. This project is really simple to hack.

This project consists of two pluggable parts:

  • Client: Send topics to GPT and get their responses
  • Renderer: Build slides from these pairs

If you want to make some changes:

  • git clone
  • change code
  • run make to build a binary file (Go installation required)
  • check
  • push to repo and send a PR

Feel free to send us PR/issues.

Changelog

[2023-03-02] Rewrite with golang. All in one file.

[2023-01-13] #2 OpenAI's services are not available in my country.

[2022-12-06] Currently, ChatGPT has no official API. I am waiting for it to make this repo a real production.

License

MIT

chat-gpt-ppt's People

Contributors

williamfzc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chat-gpt-ppt's Issues

Invalid header value

Installed chat-gpt-ppt:

    pip install -e chat-gpt-ppt

Added the token.txt and data.txt file to the example folder.
Placed the session_token within the token.txt file.

Run the following command:

    cgp token.txt data.txt

The following error was returned:

    raise ValueError('Invalid header value %r' % (values[i],))
    ValueError: Invalid header value b'__Secure-next-auth.session-token=eyJhb...

So, I then tried to update the revChatGPT to 0.2.1.

Run the same command:

    cgp token.txt data.txt

The following error is returned:

    Spawning browser...
    Browser spawned.
    Found Cloudflare Cookie!
    [...]
    tls_client.exceptions.TLSClientExeption: failed to do request: Get "https://chat.openai.com/api/auth/session": invalid HTTP header value "__Secure-next-auth.session-token=eyJhb...pBg\n; cf_clearance=tjcHJfmHgb7v9Ck46UhFHPub1jqRE5trcSDcVvfw77o-1674258058-0-1-24b796c0.804eba2d.a179b327-160" for 
header "Cookie"

What am I missing? Any help is appreciated.

Google Bard Support

Another interesting thing is that, this project can use different backends.
That's what Microsoft will not do.

panic while running cgp

OS: ubuntu 20.04
go: go version go1.20.2 linux/amd64
running command: ./cgp
token.txt and topic.txt is ready and in current directory
build command: go build ./cmd/cgp
version: HEAD

panic:
start preparing ...
panic: Post "https://api.openai.com/v1/chat/completions": net/http: invalid header field value for "Authorization"

goroutine 1 [running]:
main.panicIfErr(...)
/home/mep/ppt/chat-gpt-ppt/cmd/cgp/main.go:59
main.main.func1(0xc0000be000?)
/home/mep/ppt/chat-gpt-ppt/cmd/cgp/main.go:47 +0xd5
github.com/abiosoft/ishell/v2.(*Shell).handleCommand(0xc0000be000, {0xc000014e80, 0x1, 0x1})
/home/mep/go/pkg/mod/github.com/abiosoft/ishell/[email protected]/ishell.go:279 +0x226
github.com/abiosoft/ishell/v2.handleInput(0xc0000be000, {0xc000014e80, 0x1, 0x1})
/home/mep/go/pkg/mod/github.com/abiosoft/ishell/[email protected]/ishell.go:233 +0x31
github.com/abiosoft/ishell/v2.(*Shell).Process(...)
/home/mep/go/pkg/mod/github.com/abiosoft/ishell/[email protected]/ishell.go:229
main.main()
/home/mep/ppt/chat-gpt-ppt/cmd/cgp/main.go:53 +0x538

Plan about this project

TODO list:

  • rewrite with golang
  • replace with official ChatGPT API
  • pack and ship everything in a single file
  • pluggable model
  • pluggable renderer
  • demo server and frontend
  • better user experience

Feel free to share your ideas :) .

Rate limit issue

I would like this to support more slides, but the rate limit makes it crash every time there are more than 3 slides

AI ppt

通过gpt生成文本内容后,如何根据文本内容自动生成完整的ppt模块呢?如何获取到ppt模版呢?

improvement

  • Current renderer use raw markdown to build the slides, which easily cause info loss (e.g. emoji)
  • Simple text input (topic.txt) is hard to extend (e.g. add some special template on page 3?)
  • Current client will only simply call API with default params and parse its response one by one. As a slides it may lose some of coherence.

Feel free to append.

revChatGPT.revChatGPT

It looks like something has gone wrong with the import? Or is this expected?

While executing the script it fails with searching the module

Traceback (most recent call last):
File "/chat-gpt-ppt-main/cgp/init.py", line 4, in
from revChatGPT.revChatGPT import Chatbot
ModuleNotFoundError: No module named 'revChatGPT.revChatGPT'

Why do we build this tiny tool?

Yes I do know some big companies like microsoft are doing something like this.
And can do much much better than this project.

But it may looks like:

image

As a developer I prefer some flexible / extendable ways:

image

Nearly all the components are replaceable. So as a customer, I can freedomly choose different products from different companies to achieve my goal. Sounds great.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.