-
Notifications
You must be signed in to change notification settings - Fork 11
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
add anthropic messages support and stream #118
Conversation
@@ -214,9 +214,14 @@ async def log_async(completion_url, func, **kwargs): | |||
if "messages" in kwargs: | |||
kwargs["messages"] = flatten_messages(kwargs["messages"]) | |||
|
|||
if "anthropic" in func.__module__: | |||
if "system" in kwargs: | |||
kwargs["messages"].insert(0, {"role": "system", "content": kwargs["system"]}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anthropic messages func has a system
arg to pass system messages. This put the message into messages
like openai chat API.
log_row = { | ||
# do we want to also store args? | ||
"status": "started", | ||
"kind": "chat" if "chat" in func.__module__ or "messages" in func.__module__ else "completion", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[bug fix] seems completions needs kind
to render in GUI. So set it when post the request. Otherwise, the completions only shows after response (with kind set) posted.
c1b8eac
to
395f76e
Compare
Support Anthropic Claude-3