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: Added temporal codec server route & cookbooks. Updated the CONTRIBUTING.md file #543

Merged
merged 6 commits into from
Oct 2, 2024

Conversation

Vedantsahai18
Copy link
Member

@Vedantsahai18 Vedantsahai18 commented Oct 1, 2024

Important

Added /temporal/decode route, updated setup instructions in CONTRIBUTING.md, and modified Docker and FastAPI configurations.

  • New Features:
    • Added /temporal/decode route in router.py for decoding temporal payloads using PydanticEncodingPayloadConverter.
  • Documentation:
    • Updated CONTRIBUTING.md with setup instructions, including environment setup, Docker volume creation, and running the project in single or multi-tenant mode.
  • Configuration:
    • Added internal.router to web.py to include the new internal routes.
    • Updated docker-compose.yml to expose port 8080 for agents-api and agents-api-multi-tenant services.

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

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 485e885 in 17 seconds

More details
  • Looked at 219 lines of code in 6 files
  • Skipped 4 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/routers/internal/router.py:30
  • Draft comment:
    The decode_payloads function should return a JSON response, not a Response object. Consider changing the return type hint to dict or JSONResponse.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_3vqkZkUCpPNGzqSR


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.


# Decode route
@router.post("/temporal/decode", tags=["temporal"])
async def decode_payloads(req: Request)-> Response:
Copy link
Contributor

Choose a reason for hiding this comment

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

The decode_payloads function should return a JSON response, not a Response object. Consider changing the return type hint to dict or JSONResponse.

Copy link
Contributor

Choose a reason for hiding this comment

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

we should change return type to -> dict

CONTRIBUTING.md Outdated

```bash
npm install -g jwt-cli
Copy link
Contributor

Choose a reason for hiding this comment

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

no the lib is different: cargo install jwt-cli --locked

Copy link
Member Author

Choose a reason for hiding this comment

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

for cargo installation the users might require extra set installation like Rust and Cargo. Instead can we just ask to install 'jwt-cli' depending on their platform?

"\n",
"To recreate the notebook and see the code implementation for this task, you can access the Google Colab notebook using the link below:\n",
"\n",
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://drive.google.com/file/d/14ntgAPmm2-QD3KArc5-lyM5wCMyTx5b1/view?usp=drive_link)\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't the correct link. Use https://openincolab.com/ to generate it but make sure to change the branch name to dev

"cell_type": "markdown",
"metadata": {},
"source": [
"We get the current agent ID from the list of agents."
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the list agents, list tasks, etc. they are useless distractions

"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Copy link
Contributor

Choose a reason for hiding this comment

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

mention that list transitions doesnt wait, just lists whatever transitions have happened so far

Copy link
Contributor

Choose a reason for hiding this comment

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

and move .list() above .stream()

"cell_type": "markdown",
"metadata": {},
"source": [
"Streaming execution steps of the defined Task."
Copy link
Contributor

Choose a reason for hiding this comment

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

Mention that this is a blocking operation, waits for the execution to get over

@creatorrr
Copy link
Contributor

Also- change names of the cookbook files to something more descriptive like 01-Sarcastic_News_Headline_Generator.ipynb

@creatorrr
Copy link
Contributor

Also run poe check before merging

Copy link
Contributor

@HamadaSalhab HamadaSalhab left a comment

Choose a reason for hiding this comment

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

It would be better if you show the final output of the task execution in the cookbooks.

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 e8238b2 in 24 seconds

More details
  • Looked at 96 lines of code in 3 files
  • Skipped 4 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. agents-api/agents_api/routers/internal/router.py:15
  • Draft comment:
    Consider adding error handling for JSON parsing and payload conversion to handle potential exceptions and provide meaningful error responses.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment is actionable and suggests a code quality improvement by adding error handling, which is a valid point. The current code does not handle exceptions that might occur during JSON parsing or payload conversion, which could lead to unhandled exceptions and unclear error responses.
    The comment does not specify exactly how to implement the error handling, which might make it less actionable. However, the suggestion is clear enough to be useful for a developer to consider adding try-except blocks or similar error handling mechanisms.
    While the comment does not provide specific implementation details, it highlights a potential issue that could improve the robustness of the code. This makes it a valuable comment to keep.
    Keep the comment as it suggests a valid improvement to the code by adding error handling for potential exceptions.
2. agents-api/agents_api/routers/internal/router.py:14
  • Draft comment:
    The return type of decode_payloads should be Response instead of dict to align with FastAPI's expected return types.
  • 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 is not necessary because FastAPI supports returning a dictionary, which it automatically converts to a JSON response. The change in the diff is intentional and aligns with FastAPI's capabilities. Therefore, the comment is not correct as it suggests an unnecessary change.
    I might be missing some specific context about the project's coding standards or specific requirements that necessitate using Response. However, based on general FastAPI usage, returning a dictionary is acceptable.
    The general practice in FastAPI is to allow returning dictionaries for JSON responses, and unless there is a specific project requirement, the current implementation is correct.
    The comment should be deleted because it suggests an unnecessary change. The current return type of dict is valid in FastAPI.
3. CONTRIBUTING.md:71
  • Draft comment:
    Typo: Replace "fopr" with "for".
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The CONTRIBUTING.md file contains a minor typo that should be corrected for clarity.
4. CONTRIBUTING.md:89
  • Draft comment:
    Consider reverting the change to use {JWT_SHARED_KEY} to indicate that it is a placeholder to be replaced by the user.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The CONTRIBUTING.md file has an unnecessary change where the curly braces were removed from the JWT_SHARED_KEY placeholder. This could lead to confusion for users.

Workflow ID: wflow_U4Ma66jVM2VvMVfD


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

@creatorrr creatorrr merged commit e97ca4e into dev Oct 2, 2024
6 of 7 checks passed
@creatorrr creatorrr deleted the f/codec branch October 2, 2024 18:00
@Vedantsahai18 Vedantsahai18 restored the f/codec branch October 2, 2024 18:19
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.

3 participants