Git Product home page Git Product logo

chatpeek's Introduction

ChatPeek - a ChatGPT shared conversation link parser

ChatPeek is a Python utility for parsing shared conversation links from OpenAI's ChatGPT. It allows users to easily analyze, process and work with public human-AI conversations.

Features

  • Fetches shared conversation content from a given link.
  • Parses the content into a structured format.
  • Classifies each message in the conversation as either human or AI.
  • Provides easy access to all replies in the conversation, as well as distinguishing between human and AI replies.

Usage

First, instantiate a ChatPeek object with a shared conversation link as an argument. Then, access the Chat object via the chat property of the ChatPeek object:

chat_peek = ChatPeek("your_shared_conversation_link_here") 
chat = chat_peek.chat

You can then access the conversation title, all replies, and specific replies:

all_replies = chat.conversation
print(chat.title)
print(f"{datetime.datetime.fromtimestamp(chat.date)} | {chat.ai_model}\n")
for reply in all_replies:
    print(f"{reply.author_name} ({str(reply.type).split('.')[1]}):\n{reply.statement}\n")

Testing

Unit tests are provided in ChatPeek_test.py. To run the tests, use the following command:

python -m unittest ChatPeek_test.py

Contributing

Contributions are welcome! Please submit a pull request or create an issue to discuss any changes you wish to make.

License

This project is licensed under the MIT License.

Classes

ReplyType

An Enum for specifying the type of reply, either HUMAN or AI.

Reply

Represents a single reply in a conversation, with a author names (if public), a reply type, and the statement content.

Chat

Represents a full chat conversation, with a timestamp, user name, AI model, a title and a list of Reply objects.

ChatPeek

The main class that takes a ChatGPT shared conversation link and parses it into a Chat object.

chatpeek's People

Contributors

vl3c avatar

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.