chore: use primitives instead of typing imports and fixes completion …#149
Merged
codefromthecrypt merged 1 commit intoblock:mainfrom Oct 15, 2024
Merged
Conversation
…signature This migrates from typing imports to primitives per the following feedback from @lamchau: > :nit: i think our patterns here don't realize as of python 3.9+ we generally don't need `Dict`, `List`, and `Tuple` anymore we can use the primitives (`dict`, `list`, and `tuple` respectively) This also fixes inconsistency in our provider completion signature with regards to: * tools: more precisely allow any amount of tools as often there are none ```diff - tools: Tuple[Tool] = field(factory=tuple, converter=tuple) + tools: tuple[Tool, ...] = field(factory=tuple, converter=tuple) ``` * kwargs: providers were inconsistent on accepting this, which could lead to small bugs ```diff - messages: List[Message], - tools: Tuple[Tool], - ) -> Tuple[Message, Usage]: + messages: list[Message], + tools: tuple[Tool, ...], + **kwargs: dict[str, any], + ) -> tuple[Message, Usage]: ``` Signed-off-by: Adrian Cole <[email protected]>
This was referenced Oct 14, 2024
Merged
| @pytest.mark.parametrize( | ||
| "env_var_name", | ||
| [ | ||
| ("AZURE_CHAT_COMPLETIONS_HOST_NAME"), |
Collaborator
Author
There was a problem hiding this comment.
static analysis found this an unnecessary coersion
| @@ -1,5 +1,5 @@ | |||
| import re | |||
| from typing import Callable, List, Tuple | |||
| from typing import Callable | |||
Collaborator
Author
There was a problem hiding this comment.
in cases like this, I couldn't use the primitive as it wasn't subscriptable
Contributor
There was a problem hiding this comment.
fwiw this Callable was deprecated which kind of solves the subscriptable problem. we'd probably always need to keep one of those since i don't recall it's hinting can be expressed otherwise
Deprecated since version 3.9: collections.abc.Callable now supports subscripting ([]). See PEP 585 and Generic Alias Type.
edit: i stand corrected there is a callable primitive for hinting but not sure what's going on here
Collaborator
Author
There was a problem hiding this comment.
me neither.. if you figure it out, ping me!
Contributor
|
lgtm! |
lamchau
approved these changes
Oct 15, 2024
ahau-square
pushed a commit
that referenced
this pull request
Oct 16, 2024
* origin/main: docs: add subheaders to the 'Other ways to run Goose' section (#155) fix: Remove tools from exchange when summarizing files (#157) chore: use primitives instead of typing imports and fixes completion … (#149) chore: make vcr tests pretty-print JSON (#146) chore(release): goose 0.9.5 (#159) chore(release): exchange 0.9.5 (#158)
lukealvoeiro
added a commit
that referenced
this pull request
Oct 17, 2024
* main: (23 commits) feat: Run with resume session (#153) refactor: move langfuse wrapper to a module in exchange instead of a package (#138) docs: add subheaders to the 'Other ways to run Goose' section (#155) fix: Remove tools from exchange when summarizing files (#157) chore: use primitives instead of typing imports and fixes completion … (#149) chore: make vcr tests pretty-print JSON (#146) chore(release): goose 0.9.5 (#159) chore(release): exchange 0.9.5 (#158) chore: updates ollama default model from mistral-nemo to qwen2.5 (#150) feat: add vision support for Google (#141) fix: session resume with arg handled incorrectly (#145) docs: add release instructions to CONTRIBUTING.md (#143) docs: add link to action, IDE words (#140) docs: goosehints doc fix only (#142) chore(release): release 0.9.4 (#136) revert: "feat: add local langfuse tracing option (#106)" (#137) feat: add local langfuse tracing option (#106) feat: add groq provider (#134) feat: add a deep thinking reasoner model (o1-preview/mini) (#68) fix: use concrete SessionNotifier (#135) ...
ahau-square
pushed a commit
that referenced
this pull request
May 2, 2025
#149) Signed-off-by: Adrian Cole <[email protected]>
cbruyndoncx
pushed a commit
to cbruyndoncx/goose
that referenced
this pull request
Jul 20, 2025
block#149) Signed-off-by: Adrian Cole <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…signature
This migrates from typing imports to primitives per the following feedback from @lamchau:
This also fixes inconsistency in our provider completion signature with regards to: