Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAI code interpreter (draft) #37

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix no-markdown mode
  • Loading branch information
kharvd committed Jun 24, 2023
commit b793eef3757f25c0567e0a929c9a4fb85ce37e9a
12 changes: 9 additions & 3 deletions gptcli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,15 @@ def print(self, message_delta: Message):
self.live.update(content)
self.live.refresh()
else:
self.console.print(
Text(message_delta.get("content") or "", style="green"), end=""
)
text = message_delta.get("content") or ""
function_call = message_delta.get("function_call")
if function_call:
if "name" in function_call:
text += function_call["name"]
if "arguments" in function_call:
text += function_call["arguments"]

self.console.print(Text(text, style="green"), end="")

def __exit__(self, *args):
if self.markdown:
Expand Down