Metadata-Version: 2.1
Name: g4f_xn
Version: 0.0.6
Summary: library for easy access to GPT models based on g4f
Author: Xandr0v
Author-email: <olegalexandrov468@gmail.com>
Keywords: python,g4f,gpt
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: Microsoft :: Windows
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: g4f
Requires-Dist: pyaudio
Requires-Dist: pydub
Requires-Dist: colorama

### g4f_xn

---
#### A library that allows you to use different GPT models!

Also has some other stuff like:
- reading and writing to files
- sound playback(i mean why not)
- other functions for convenience

The project is not ready for public use, but more for a fun and convinient (in my opinion) use of gpt models 

#### code example:

```python
import g4f_xn as xn

# specify model
xn.settings('gpt-3.5-turbo')

prompt = '''
type numbers from 1 to 10
'''

result = xn.gpt(prompt)
print(result)
```

---
also you can provide an array to xn.gpt that will represent history of previous prompts and answers. It will use it as context and append prompt with response.


#### advanced example:

```python
import g4f_xn as xn

# specify model and provider
xn.settings('gpt-4', 'Bing')

p1 = '''
type numbers from 1 to 10
'''
p2 = '''
multiply each number by 2
'''

chat = []

r1 = xn.gpt(p1, chat)
r2 = xn.gpt(p2, chat)
print(r1)  # 1, 2, 3, ...
print(r2)  # 2, 4, 6, ...
```
---

#### gpt -> chat gpt
You can also save chat variable to txt file using xn.write, xn.read <br>
it will be basically chatgpt now

#### example with local chat history:

```python
import g4f_xn as xn

xn.settings('gpt-3.5-turbo')

history = xn.read(r'path/to/file.txt')
chat = [history]
prompt = '''
type numbers from 1 to 10
'''

result = xn.gpt(prompt, chat)
print(result)

xn.write(''.join(chat), r'path/to/file.txt')
```
---
It is highly recommended to use .ipynb files with this library as it is really flexible for that task


