Comments (10)
Seems that this is caused by rich text, you may try copy and paste as plaintext to see if it solves the problem.
from gptcli.
I've update the code to add .save
command to save conversation to file, by copying the content in the json file you may get the original results. I am also planing to add options to save/load conversation file as text file (markdown), and it would be more friendly for human reading.
from gptcli.
Seems that this is caused by rich text, you may try copy and paste as plaintext to see if it solves the problem.
I just tried it and looks fine but still has tons of blank spaces surrounding the code.
Also, paste it as plaintext is not available for some editors. I had to open it in Writer Document in Libre Office to be able to paste it as Unformatted Text
(and blank spaces are still everywhere).
The idea of saving it is great though! Thanks, @evilpan . You are not so evil after all ;)
from gptcli.
I just git pulled but i don't get how to use .save.
This is what I do:
~/workspace/gptcli$ ./gptcli.py
Loading config from /home/user/workspace/gptcli/config.json
Response in prompt: True
Stream mode: True
Input:
I don't see the gptclip>
as shown in README . Then in the input prompt I type .save
and get back:
I'm sorry, I cannot perform file operations such as saving a file. However, I can still help you with any questions or information you need.
from gptcli.
Also tried this:
./gptcli.py .save
usage: gptcli.py [-h] [-c CONFIG]
gptcli.py: error: unrecognized arguments: .save
from gptcli.
Seems you are not using the latest code, are you sure the git pull
command returns successfully?
from gptcli.
Sorry, i thought I was git pulling but didn't notice I was getting an error back, so I wasn't really pulling anything.
Anyway, I fixed the error and git pulled your latest commits but now it fails with FileNotFoundError: [Errno 2] No such file or directory /home/user/gptcli/config.json
. I see the default config file is config.json
in code, but in the repo you have it named as demo_config.json
. So it fails when starting it up. So i had to start it with ./gptcli.py -c demo_config.json
(which i didn't want to as i wanted to run on defaults without any arg flag).
Now, since i deleted the OpenAi key from the config (so it can it read from the environment) it fails with :
OpenAIError: You didn't provide an API key...
from gptcli.
Anyway! I can save the chat!
[
{
"role": "user",
"content": "write a python script that prints 'hello, world!' and the time."
},
{
"role": "assistant",
"content": "Here's a Python script that prints 'Hello, World!' and the current time:\n\n```python\nimport datetime\n\ncurrent_time = datetime.datetime.now().strftime(\"%Y-%m-%d %H:%M:%S\")\nprint(\"Hello, World!\")\nprint(\"Current Time:\", current_time)\n```\n\nJust copy and paste the code above into a Python file, save it, and run the file to see the output."
}
]
Now it's a matter of just parsing the json file. I'm gonna ask it to write a python script to parse it and get the python script from it.
Oh wait. :/
from gptcli.
Hi! Now we can save/load from both JSON and Markdown file, using the following command:
.save [-m {json, md}] file
.load [-m {json, md}] file
And we use the md (markdown) format by default now.
See: 0777a45
from gptcli.
Hi! Now we can save/load from both JSON and Markdown file, using the following command:
.save [-m {json, md}] file .load [-m {json, md}] file
And we use the md (markdown) format by default now.
See: 0777a45
Ah, amazing! Now the tool is super useful. Thanks so much!
from gptcli.
Related Issues (20)
- 如何一次输入多行文字? HOT 3
- The model: `gpt-4` and `gpt-4-32k` does not exist. HOT 1
- Error communicating with OpenAI: Missing dependencies for SOCKS support. HOT 2
- Feature request: Add support for ChatGPT plugins HOT 1
- 使用.save 保存到文件时,中文乱码 HOT 1
- Answer with panic HOT 2
- Feature request: Estimate token use/cost HOT 2
- 如何在容器内配置宿主机的代理地址,现在配置还是报错 HOT 6
- .help不展示Console help HOT 1
- ChatGPT UI App HOT 1
- Can I use it with Azure openai service HOT 5
- 有时候输入几个字符然后使用退格建会导致显示问题 HOT 1
- 获取输出的时候会多次重复显示。
- Not working on windows 11 HOT 4
- windows10不可用 HOT 1
- Saving session to file
- cannot import name 'MarkdownIt' from 'rich.markdown' HOT 2
- response displayed word by word, line by line. HOT 16
- Please make the pyreadline dependency optional (for platforms with no c compiler) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gptcli.