Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
anpl
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ziyuan Nan
anpl
Commits
94c564ec
Commit
94c564ec
authored
May 12, 2023
by
nzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix multiline input and show all codes to user
parent
b464f74c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
anpl/anpl.py
+2
-2
utils.py
+2
-6
No files found.
anpl/anpl.py
View file @
94c564ec
...
...
@@ -108,7 +108,7 @@ black, blue, red, green, yellow, grey, pink, orange, teal, maroon = range(10)
funs_list
,
queue
=
[],
[
name
]
while
len
(
queue
)
!=
0
:
fun
=
queue
.
pop
(
0
)
if
fun
in
self
.
funs
:
if
(
fun
in
self
.
funs
)
and
(
fun
not
in
funs_list
)
:
funs_list
.
append
(
fun
)
queue
.
extend
(
name
for
name
in
self
.
funs
[
fun
]
.
dependencies
)
return
funs_list
...
...
@@ -145,7 +145,7 @@ black, blue, red, green, yellow, grey, pink, orange, teal, maroon = range(10)
return
[
f
.
name
for
f
in
self
.
funs
.
values
()
if
not
f
.
code
]
def
user_known_funs
(
self
)
->
list
[
str
]:
return
[
f
.
name
for
f
in
self
.
funs
.
values
()
if
f
.
code_from_user
or
f
.
prompt_from_user
]
return
[
f
.
name
for
f
in
self
.
funs
.
values
()]
def
to_python
(
self
,
name
:
Optional
[
str
]
=
None
,
for_user
=
False
)
->
str
:
funs_name
=
reversed
(
self
.
find_dependencies
(
name
or
self
.
entry
))
...
...
utils.py
View file @
94c564ec
...
...
@@ -11,6 +11,7 @@ import openai
import
time
import
os
import
pickle
import
sys
colors
=
[
"#000000"
,
"#0000FF"
,
"#FF0000"
,
"#008000"
,
"#FFFF00"
,
"#808080"
,
"#FFC0CB"
,
"#FFA500"
,
"#008080"
,
"#800000"
]
...
...
@@ -60,12 +61,7 @@ def rich_dumps(obj):
def
multiline_input
():
buffer
=
''
while
True
:
print
(
"[blue]->[/blue]"
,
end
=
""
)
line
=
input
()
if
not
line
:
break
buffer
+=
line
+
"
\n
"
buffer
=
sys
.
stdin
.
read
()
return
buffer
sys_str
=
"[bold red]SYSTEM: [/bold red]"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment