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

feat: Refactor create agent endpoint into DI pattern #1063

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

whiterabbit1983
Copy link
Contributor

No description provided.

Copy link
Contributor

qodo-merge-pro-for-open-source bot commented Jan 16, 2025

CI Failure Feedback 🧐

(Checks updated until commit 5a6b95a)

Action: Typecheck

Failed stage: Typecheck [❌]

Failed test name: agents_api.queries.base_queries

Failure summary:

The pytype static type checker failed during the PR action due to an invalid type annotation in the
file agents_api/queries/base_queries.py. Specifically:

  • The error occurred in the wrap_single generic parameters at line 73
  • The type annotation '' was marked as invalid
  • This caused the build process to fail and stop further progress

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    1205:  [8/296] check agents_api.autogen.Chat
    1206:  [9/296] check agents_api.autogen.Files
    1207:  [10/296] check agents_api.autogen.Executions
    1208:  [11/296] check agents_api.autogen.Entries
    1209:  [12/296] check agents_api.common.utils.datetime
    1210:  [13/296] check agents_api.autogen.Tasks
    1211:  [14/296] check agents_api.autogen.Agents
    1212:  [15/296] check agents_api.queries.utils
    1213:  ERROR:pytype.matcher Invalid type: <class 'pytype.abstract.function.ParamSpecMatch'>
    1214:  [16/296] check agents_api.queries.base_queries
    1215:  FAILED: /home/runner/work/julep/julep/agents-api/.pytype/pyi/agents_api/queries/base_queries.pyi 
    1216:  /home/runner/work/julep/julep/agents-api/.venv/bin/python -m pytype.main --disable pyi-error --imports_info /home/runner/work/julep/julep/agents-api/.pytype/imports/agents_api.queries.base_queries.imports --module-name agents_api.queries.base_queries --platform linux -V 3.12 -o /home/runner/work/julep/julep/agents-api/.pytype/pyi/agents_api/queries/base_queries.pyi --analyze-annotated --nofail --none-is-not-bool --quick --strict-none-binding /home/runner/work/julep/julep/agents-api/agents_api/queries/base_queries.py
    1217:  /home/runner/work/julep/julep/agents-api/agents_api/queries/base_queries.py:73:5: error: in <generic parameters of wrap_single>: Invalid type annotation '<instance of Callable>' for return [invalid-annotation]
    ...
    
    1229:  self.logger.debug("Records fetched: %s", records)
    1230:  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1231:  data = [dict(r.items()) for r in records]
    1232:  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1233:  assert len(data) == 1, f"Expected one result, got {len(data)}"
    1234:  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1235:  return cls(**self.transform_record(data[0]))
    1236:  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1237:  For more details, see https://google.github.io/pytype/errors.html#invalid-annotation
    ...
    
    1424:  [203/296] check agents_api.common.utils.json
    1425:  [204/296] check agents_api.common.exceptions.sessions
    1426:  [205/296] check agents_api.autogen.__init__
    1427:  [206/296] check agents_api.metrics.__init__
    1428:  [207/296] check tests.test_nlp_utilities
    1429:  [208/296] check agents_api.rec_sum.__init__
    1430:  [209/296] check tests.__init__
    1431:  [210/296] check agents_api.rec_sum.entities
    1432:  ninja: build stopped: cannot make progress due to previous errors.
    1433:  Computing dependencies
    1434:  Generated API key since not set in the environment: 13548877969840198981230222759416
    1435:  Sentry DSN not found. Sentry will not be enabled.
    1436:  Analyzing 286 sources with 0 local dependencies
    1437:  Leaving directory '.pytype'
    1438:  ##[error]Process completed with exit code 1.
    

    ✨ CI feedback usage guide:

    The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
    The tool analyzes the failed checks and provides several feedbacks:

    • Failed stage
    • Failed test name
    • Failure summary
    • Relevant error logs

    In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

    /checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
    

    where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

    Configuration options

    • enable_auto_checks_feedback - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
    • excluded_checks_list - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
    • enable_help_text - if set to true, the tool will provide a help message with the feedback. Default is true.
    • persistent_comment - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
    • final_update_message - if persistent_comment is true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.

    See more information about the checks tool in the docs.



    class Queries(containers.DeclarativeContainer):
    wiring_config = containers.WiringConfiguration(modules=["agents_api.routers.agents"])
    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    There should be a way to enable wiring for all modules at once

    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.

    1 participant