Skip to content

Releases: Simatwa/python-tgpt

v0.2.1

10 Jan 18:33
Compare
Choose a tag to compare

What's new?

v0.2.0

09 Jan 23:04
Compare
Choose a tag to compare

What's new?

  • Multiple LLM providers 🥇 : This release marks another significant milestone in the python-tgpt series, as it features the capabilities of interacting with multiple free models as well as the legendary ChatGPT models.

Note : All providers have got a common class methods and few common class variables such as last_response.

Openai

import tgpt.openai as openai
bot = openai.OPENAI("<OPENAI-API-KEY>")
print(bot.chat("<Your-prompt>"))

Koboldai

import tgpt.koboldai as koboldai
bot = koboldai.KOBOLDAI()
print(bot.chat("<Your-prompt>"))

Fakeopen

import tgpt.fakeopen as fakeopen
bot = fakeopen.FAKEOPEN()
print(bot.chat("<Your-prompt>"))

Opengpt

import tgpt.opengpt as opengpt
bot = opengpt.OPENGPT()
print(bot.chat("<Your-prompt>"))

v0.1.4

06 Jan 09:59
Compare
Choose a tag to compare

v0.1.4

What's new?

  • Incomplete response - fixed

v0.1.3

05 Jan 22:24
Compare
Choose a tag to compare

v0.1.3

What's new?

  • Invalid response - fixed

v0.1.2

04 Jan 13:52
Compare
Choose a tag to compare

What's new?

  • generate - default mode when prompt passed
  • interactive - default mode when no prompt passed

Note: This is the first release with executables (binaries).

Warning : Executable for Mac is missing.

v0.1.1

03 Jan 18:38
Compare
Choose a tag to compare

What's new?

  • Bug fixed - file not found error

v0.1.0

03 Jan 14:09
Compare
Choose a tag to compare

What's new?

  • Chatting conversationally - Default mode

Note : This release represents a significant milestone in the python-tgpt and tgpt series. Introducing a groundbreaking feature: the ability to regenerate prompts based on the chat history. This mode revolutionizes the interactive experience by granting superior control over the chat history and fostering more refined responses. 🥇


Here is an example of a console based chat:

You're a Large Language Model for chatting with people. Your role: Provide ONLY response.

User : Hello there

LLM : Hello! How may I assist you today?

User : I wanna learn how to code.

LLM : Great to hear that you want to learn how to code! There are so many resources available online to help you get started. Would you like me to recommend some websites or tutorials that can help you learn the basics of programming? Additionally, what programming language are you interested in learning? Python, JavaScript, HTML/CSS, or something else?

User : I'm interested in Python.

LLM : Great choice! Python is a popular and versatile programming language that is widely used in many different areas, such as web development, data analysis, and machine learning.

Here are some websites and resources that can help you get started with learning Python:

  1. Codecademy: Codecademy is an online platform that offers interactive coding lessons in Python and other programming languages. You can start with their introduction to Python course, which covers the basics of the language.
  2. Python.org: The official Python website provides a comprehensive documentation and tutorials for beginners, including an introduction to the language, its syntax, and built-in functions.
  3. Coursera: Coursera is an online learning platform that offers a variety of courses on Python, including introductory courses and more advanced courses that cover specific topics like data science and machine learning.
  4. edX: edX is another online learning platform that offers a wide range of courses on Python, including courses from top universities like MIT and UC Berkeley.
  5. Real Python: Real Python is a comprehensive guide to learning Python, with tutorials, articles, and resources for beginners and experienced programmers alike.

Once you have a good understanding of the basics, I recommend practicing coding exercises and projects to improve your skills. You can find many coding exercises and projects online, or you can try creating your own projects based on your interests.

Good luck with your coding journey! Do you have any specific questions or areas of interest within Python that you'd like to explore further?

User : Yeah sure. Are there prerequisite for learning that?

LLM : No, there aren't any specific prerequisites for learning Python. However, having a basic understanding of programming concepts and computer science fundamentals can be helpful, but it's not necessary. Python is a high-level language, so it has a relatively gentle learning curve compared to other languages. Additionally, there are many resources available online that cater to beginners, including tutorials, videos, and coding challenges.

That being said, familiarity with basic programming concepts such as data types, variables, loops, conditionals, functions, and objects will make it easier for you to understand the material. Moreover, having a good understanding of logic and problem-solving skills will help you to write more efficient and effective code.

In terms of resources, I recommend starting with the official Python documentation, which provides an exhaustive introduction to the language, including its syntax, built-in functions, and advanced concepts. Online platforms like Codecademy, Coursera, and edX also offer a wide range of courses and tutorials to help you get started with Python.

Do you have any other questions or concerns before you begin your coding journey?

User : Walk me through some basics of that language.

LLM : Sure! Here are some basics of the Python programming language:

  1. Variables and Data Types: In Python, you can store values in variables, which can be of different data types such as integers, floats, strings, and booleans. You can declare variables using the assignment operator (=). For example, x = 5 declares a variable x and assigns the value 5 to it.
  2. Indentation: Python uses indentation to define blocks of code. The indentation size is usually 4 spaces. For example, if you want to define a block of code that runs only when a certain condition is true, you can use the if-else statement, like this: if x > 5: print("x is greater than 5")
  3. Loops: Python has two types of loops: for loops and while loops. For loops are used when you know the number of iterations you want to perform, while while loops are used when you don't know the number of iterations. For example, for x in range(5): print(x) will print the numbers 0 through 4.
  4. Functions: Functions are groups of code that perform a specific task. In Python, you can define your own functions using the def keyword. For example, def greet(name): print("Hello, " + name) will print a greeting message with the given name.
  5. Modules: Python has a large standard library of pre-written code that you can use in your own programs. You can import modules using the import keyword. For example, import math allows you to use the mathematical functions defined in the math module.

These are just a few of the basics of Python, but there's much more to learn! Do you have any specific questions or areas of interest you'd like to explore further?

User : Nice. Could you generate a number guessing game in that language.

LLM : Sure, here is a simple number guessing game in Python:

# Define a function to generate a random number
def get_random_number():
  # Generate a random number between 1 and 100
  return random.randint(1, 100)

# Define a function to play the game
def play_game():
  # Ask the user to guess a number
  print("Guess a number between 1 and 100:")
  guess = int(input())

  # Check if the user's guess is correct
  if guess == get_random_number():
    print("Correct! The number was:", get_random_number())
  else:
    print("Incorrect. The number was:", get_random_number())

# Ask the user if they want to play the game
print("Do you want to play the number guessing game? (yes/no):")
response = input().lower()

if response == "yes":
  play_game()
else:
  print("OK, see you next time!")

Here's how the game works:

  1. The get_random_number() function generates a random number between 1 and 100.
  2. The play_game() function asks the user to guess a number, then checks if the user's guess is correct by comparing it to the random number generated by get_random_number().
  3. If the user's guess is correct, the function prints a message indicating that the guess was correct and the random number.
  4. If the user's guess is incorrect, the function prints a message indicating that the guess was incorrect and the random number.
  5. Finally, the script asks the user if they want to play the game again, and exits if they respond negatively.

To play the game, simply run the script and follow the prompts. Good luck guessing the random number!

v0.0.9

03 Jan 00:12
Compare
Choose a tag to compare

What's new?

  • Chatting conversationally - Stable

v0.0.8

02 Jan 21:14
Compare
Choose a tag to compare

What's new?

  • Reading piped input as prompt - (Console). Thanks to @sameedzahoor
  • Reset conversation - (Console)
  • View conversation history - (Console)
  • Other minor fixes

v0.0.7

02 Jan 15:46
Compare
Choose a tag to compare

What's new?

  • Chat conversationally - (Experimental)
  • Maintain chat history .txt
  • Load chat history from file
  • Chain request through proxies