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

create cruise related artifact in cruise api #1355

Merged
merged 2 commits into from
Dec 9, 2024

Conversation

wintonzheng
Copy link
Contributor

@wintonzheng wintonzheng commented Dec 9, 2024

Important

Integrate ObserverCruise with database and API handlers, enhancing artifact management for ObserverCruise and LLM prompts and responses.

  • ObserverCruise Integration:
    • Introduce ObserverCruise in observer_service.py for initializing and updating observer cruises.
    • Add create_observer_cruise_artifact() and create_llm_artifact() in manager.py for handling artifacts.
    • Update update_observer_cruise() in client.py to support new fields.
  • LLM API Handler:
    • Modify llm_api_handler_with_router_and_fallback() and llm_api_handler() in api_handler_factory.py to include observer_cruise and observer_thought parameters.
    • Use create_llm_artifact() for managing LLM-related artifacts.
  • Database Enhancements:
    • Add create_observer_cruise() and update_observer_cruise() in client.py for managing ObserverCruise records.
    • Extend ArtifactManager in manager.py to support ObserverCruise artifacts.
    • Add created_at and modified_at columns to observer_cruises and observer_thoughts tables in Alembic migration 33df1f8e9e18_add_created_at_and_modified_at_to_.py.

This description was created by Ellipsis for fa17147. It will automatically update as commits are pushed.

<!-- ELLIPSIS_HIDDEN -->

> [!IMPORTANT]
> Integrate `ObserverCruise` with database support, API handler modifications, and artifact management enhancements.
>
>   - **ObserverCruise Integration**:
>     - Introduce `ObserverCruise` in `observer_service.py` to initialize and update observer cruises.
>     - Add `create_observer_cruise_artifact()` and `create_llm_artifact()` in `manager.py` to handle ObserverCruise artifacts.
>     - Update `update_observer_cruise()` in `client.py` to support new fields.
>   - **LLM API Handler**:
>     - Modify `llm_api_handler_with_router_and_fallback()` and `llm_api_handler()` in `api_handler_factory.py` to include `observer_cruise` and `observer_thought` parameters.
>     - Use `create_llm_artifact()` to manage artifacts related to LLM prompts and responses.
>   - **Database Enhancements**:
>     - Add `create_observer_cruise()` and `update_observer_cruise()` in `client.py` to manage ObserverCruise records.
>     - Extend `ArtifactManager` in `manager.py` to support ObserverCruise artifacts.
>     - Add `created_at` and `modified_at` columns to `observer_cruises` and `observer_thoughts` tables in Alembic migration `33df1f8e9e18_add_created_at_and_modified_at_to_.py`.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=Skyvern-AI%2Fskyvern-cloud&utm_source=github&utm_medium=referral)<sup> for 2682cbe1164d46214c5e87a2fa9f53c5e0c26deb. It will automatically update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on fe7a6c8 in 50 seconds

More details
  • Looked at 407 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. skyvern/forge/sdk/artifact/manager.py:134
  • Draft comment:
    The create_llm_artifact method is missing a return statement. Consider returning a value to indicate success or failure.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment suggests adding a return statement to indicate success or failure, but the method is designed to return None as per its signature. The method's operations are asynchronous and involve creating artifacts, which are handled by other methods that return strings. The absence of a return statement is intentional and aligns with the method's design, making the comment unnecessary.
    I might be overlooking the possibility that the method should indeed return a value for consistency with other methods, but the current design does not indicate this need.
    The method's signature and its operations suggest that returning None is intentional, and the comment does not provide strong evidence for a required change.
    The comment about the missing return statement in create_llm_artifact is not valid as the method is designed to return None. The comment should be deleted.
2. skyvern/forge/sdk/api/llm/models.py:83
  • Draft comment:
    The observer_thought parameter should be typed as ObserverThought, not ObserverCruise.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment suggests a type change for 'observer_thought', but there is no evidence in the provided context that 'ObserverThought' is a valid or necessary type. Without evidence or additional context, the comment seems speculative. The rules state to only keep comments with strong evidence of correctness.
    It's possible that 'ObserverThought' is defined elsewhere in the codebase, and the comment is correct based on that context. However, without that context, it's speculative.
    Given the lack of evidence in the provided context, the comment appears speculative. The rules prioritize strong evidence within the given context.
    Delete the comment as it lacks strong evidence and appears speculative based on the provided context.
3. skyvern/forge/sdk/api/llm/api_handler_factory.py:82
  • Draft comment:
    The create_llm_artifact method is missing a return statement. Consider returning a value to indicate success or failure.
  • Reason this comment was not posted:
    Marked as duplicate.
4. skyvern/forge/sdk/api/llm/api_handler_factory.py:181
  • Draft comment:
    The create_llm_artifact method is missing a return statement. Consider returning a value to indicate success or failure.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_5hDYaZZbwFzrDV52


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to fe7a6c8 in 1 minute and 35 seconds

More details
  • Looked at 407 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. skyvern/forge/sdk/api/llm/models.py:83
  • Draft comment:
        observer_thought: ObserverThought | None = None,
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment suggests a change that could be valid if 'observer_thought' is intended to be of a different type than 'observer_cruise'. However, without additional context or evidence that 'ObserverThought' is a valid and intended type, it's speculative. The current code uses 'ObserverCruise' for both parameters, which might be intentional.
    I might be missing the context of whether 'ObserverThought' is a valid type or if there's a convention in the codebase for using different types for these parameters.
    Without explicit evidence or context indicating that 'ObserverThought' is a valid and intended type, the comment remains speculative.
    Delete the comment as it lacks strong evidence and seems speculative without further context.
2. skyvern/forge/sdk/artifact/manager.py:106
  • Draft comment:
    Ensure that observer_cruise_id is always available and valid when calling create_observer_cruise_artifact to avoid potential issues with task management.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The create_observer_cruise_artifact method in ArtifactManager uses observer_cruise.observer_cruise_id as the aio_task_primary_key. This is consistent with the pattern used in other methods like create_observer_thought_artifact. However, it's important to ensure that observer_cruise_id is always available and valid when this method is called.

Workflow ID: wflow_cJ2fgtxKbjkd6ydn


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

step: Step | None = None,
observer_thought: ObserverThought | None = None,
observer_cruise: ObserverCruise | None = None,
) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding a check to ensure that at least one of step, observer_cruise, or observer_thought is provided. If none are provided, raise a ValueError to prevent silent failures.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on fa17147 in 30 seconds

More details
  • Looked at 43 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_tcLEW0jcHeKPFQdt


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@wintonzheng wintonzheng merged commit 5842bfc into main Dec 9, 2024
2 checks passed
@wintonzheng wintonzheng deleted the shu/artifacts_in_cruise_api branch December 9, 2024 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant