-
Notifications
You must be signed in to change notification settings - Fork 571
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
Enable sane naming of registered objects with defaults #429
Conversation
@@ -9,7 +9,7 @@ | |||
import pytest |
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.
Follow up: rebase and update eval_task/datasets/scoring_functions fixtures.
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 fixed them now
@json_schema_type | ||
class VectorMemoryBankParams(BaseModel): | ||
class VectorMemoryBank(MemoryBankResourceMixin): |
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.
Wondering if we need to regenerate OpenAPI spec with this change?
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.
No - I don't think the actual types should change. But I will regenerate anyway @yanxi0830
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.
Done. There are a few small changes. I am cleaning up shields anyway in the next PR so there will be more changes there.
b56fd29
to
ba8afa9
Compare
|
||
|
||
@json_schema_type | ||
class ModelInput(CommonModelFields): |
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.
Wondering if the register_model
should also use ModelInput
?
async def register_model(
self,
model_id: str,
provider_model_id: Optional[str] = None,
provider_id: Optional[str] = None,
metadata: Optional[Dict[str, Any]] = None,
) -> Model: ...
If seems like we have 3 different structures now associated with a resource?
Model
--> datastrcuture for model fieldsModelInput
--> for specifying StackRunConfig pre-registrationregister_model
--> flattened args forModelInput
?
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.
That is correct. For now, I left it as now because I think register_model()'s API looks nice as is. Adding a structure to it makes it feel unnecessarily annoying. And internally, ModelInput does get destructured and passed to register_model() so any incompatibility is immediately flagged.
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.
Also ModelInput
is purely for the Stack-server-side developer. Only necessary and used in StackRunConfig. Maybe I should think about moving it there, but it helps to keep it here to make it consistent perhaps.
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 will kill @json_schema_type
from these input fields for sure. They should not be in OpenAPI schema.
0ab9e8a
to
593ba80
Compare
What does this PR do?
This is a follow-up to #425. That PR allows for specifying models in the registry, but each entry needs to look like:
This is headache-inducing.
The current PR makes this situation better by adopting the shape of our APIs. Namely, we need the user to only specify
model-id
. The rest should be optional and figured out by the Stack. You can always override it.Here's what example
ollama
"full stack" registry looks like (we still need to kill or simplify shield_type crap):Test Plan
See test plan for #425. Re-ran it.