Code Monkey home page Code Monkey logo

Comments (6)

reorx avatar reorx commented on May 11, 2024 1

Good idea. Additional thoughts:

  • we don't need to call it "conversation mode" since using a history file is already conversational.
  • name this argument --history, the usage would be like ai --history /path/to/history.json <other args>, if an additional -w is added, the history.json would be updated with the new messages input and generated in this call
  • the content ofhistory.json would be the dump of ChatSession.messages which is an array of dict items

Should be implemented in a day or two

from ai.py.

Cyborgscode avatar Cyborgscode commented on May 11, 2024 1

works like a charm :D

from ai.py.

Cyborgscode avatar Cyborgscode commented on May 11, 2024

ChatGPT via ai.py is now implemented in 3 modes of work "FreeTalk" : talk to it like a human, "Keyword": react only if a certain word is used and as "GapFiller": helping out with a reaction in case no local result is processed.

from ai.py.

reorx avatar reorx commented on May 11, 2024

I made it, but after further consideration, I didn't make --history to imply conversation mode, so -c is still needed to achieve your requirement. See the example below:

ai --history history.json -w -c 'remeber that a = 1, I will ask you later'
Sure, I'll be here. Feel free to ask me anything you need help with later on.

ai --history history.json -w -c 'what is a + 2 in short?'
a + 2 is equal to 3 since a was previously defined as 1.

history.json after running the two commands:

[
  {
    "role": "user",
    "content": "remeber that a = 1, I will ask you later"
  },
  {
    "role": "assistant",
    "content": "Sure, I'll be here. Feel free to ask me anything you need help with later on."
  },
  {
    "role": "user",
    "content": "what is a + 2 in short?"
  },
  {
    "role": "assistant",
    "content": "a + 2 is equal to 3 since a was previously defined as 1."
  }
]

from ai.py.

Cyborgscode avatar Cyborgscode commented on May 11, 2024

and how does the script know, which role it should use?

from ai.py.

Cyborgscode avatar Cyborgscode commented on May 11, 2024

ahh ok, forget the question.

from ai.py.

Related Issues (6)

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.