-
Notifications
You must be signed in to change notification settings - Fork 12
feat: support chat completion in studio SDK #84
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
Conversation
|
@asafgardin Just a reminder that the name won't be gaia. I'm still waiting for Omri to say whether it's going to be "jamba" / "jamba-small" or something else... |
| from ai21.models import RoleType | ||
| from ai21.models.chat import ChatMessage | ||
|
|
||
| system = "You're a support engineer in a SaaS company" |
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.
Shouldn't this file be nested under chat/completions?
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.
I put it under examples/chat/chat_completions.py
ai21/models/chat/chat_message.py
Outdated
| @@ -0,0 +1,12 @@ | |||
| from dataclasses import dataclass | |||
|
|
|||
| from ai21.models import RoleType | |||
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.
Maybe role type should be under chat and exported in models? This ways users won't need to guess where to import it from
ai21/models/chat/__init__.py
Outdated
| @@ -0,0 +1,5 @@ | |||
| from __future__ import annotations | |||
|
|
|||
| from .chat_message import ChatMessage as ChatMessage | |||
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.
Why do you need these aliases?
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.
ruff was removing imports that weren't in the main __init__.py saying these imports were not used, where in-fact they were. This was a workaround I saw was used.
I found a better solution to configure ruff to not removed these types of imports from any __init__.py (see pyproject.yaml
pyproject.toml
Outdated
| [tool.ruff] | ||
| line-length = 120 | ||
| [tool.ruff.per-file-ignores] | ||
| "__init__.py" = ["F401"] |
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.
what's that?
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.
Look at this comment - #84 (comment)
No description provided.