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

use settings for some defaults, avoid warnings #682

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

zzstoatzz
Copy link
Collaborator

@zzstoatzz zzstoatzz commented Dec 14, 2023

a couple tweaks from playing with the service-layer branch

this is looking cool!

does marvin._mappings.types nullify what we have in marvin.serializers for the most part?

@@ -41,9 +40,6 @@ def chat_completion_to_model(
data: dict[str, Any] = {}
data[field_name] = json.loads(tool_arguments[0])
return response_model.model_validate_json(json.dumps(data))
else:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was unreachable

@@ -26,6 +26,7 @@ def cast_type_to_model(

return create_model(
model_name,
__doc__=model_description,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model_description was unused

client: Optional[Client] = None
aclient: Optional[AsyncClient] = None
temperature: Optional[float] = None
temperature: Optional[float] = marvin.settings.openai.chat.completions.temperature
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was getting 400s without these

@@ -44,17 +46,17 @@ class AIFunctionKwargs(TypedDict):


class AIFunctionKwargsDefaults(BaseModel):
model_config = ConfigDict(arbitrary_types_allowed=True)
model_config = ConfigDict(arbitrary_types_allowed=True, protected_namespaces=())
Copy link
Collaborator Author

@zzstoatzz zzstoatzz Dec 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid warning about infringing on sacred model_* namespace

@zzstoatzz zzstoatzz merged commit 66a26b9 into service-layer Dec 14, 2023
10 of 12 checks passed
@zzstoatzz zzstoatzz deleted the service-layer-tweaks branch December 14, 2023 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants