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

Bump LiteralAI version #1376

Merged
merged 15 commits into from
Oct 2, 2024
Merged

Bump LiteralAI version #1376

merged 15 commits into from
Oct 2, 2024

Conversation

dokterbob
Copy link
Collaborator

@dokterbob dokterbob commented Sep 26, 2024

Requires:

  • Manual testing
  • Mock unit testing

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. backend Pertains to the Python backend. size:L This PR changes 100-499 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Sep 26, 2024
@dokterbob dokterbob added the unit-tests Has unit tests. label Sep 27, 2024
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Sep 27, 2024
@dokterbob dokterbob added the review-me Ready for review! label Sep 30, 2024
@dokterbob
Copy link
Collaborator Author

During manual evaluation, I've been getting:

I'm doing further testing right now.

@dokterbob
Copy link
Collaborator Author

dokterbob commented Sep 30, 2024

I've confirmed that #1370 is present in main.

The PaginatedResponse errors do seem to correspond with pyright output:

chainlit/backend/chainlit/data/literalai.py:342:16 - error: Type "PaginatedResponse[Thread]" is not assignable to return type "PaginatedResponse[ThreadDict]"
    "PaginatedResponse[Thread]" is not assignable to "PaginatedResponse[ThreadDict]"
      Type parameter "T@PaginatedResponse" is covariant, but "Thread" is not a subtype of "ThreadDict"
        "Thread" is not assignable to "ThreadDict" (reportReturnType)
chainlit/backend/chainlit/data/literalai.py:344:46 - error: Cannot access attribute "pageInfo" for class "PaginatedResponse[Thread]"
    Attribute "pageInfo" is unknown (reportAttributeAccessIssue)
chainlit/backend/chainlit/data/literalai.py:345:46 - error: Cannot access attribute "pageInfo" for class "PaginatedResponse[Thread]"
    Attribute "pageInfo" is unknown (reportAttributeAccessIssue)
chainlit/backend/chainlit/data/literalai.py:346:44 - error: Cannot access attribute "pageInfo" for class "PaginatedResponse[Thread]"
    Attribute "pageInfo" is unknown (reportAttributeAccessIssue)
chainlit/backend/chainlit/data/literalai.py:364:42 - error: Argument of type "Step" cannot be assigned to parameter "step" of type "Step" in function "check_add_step_in_cot"
    "literalai.observability.step.Step" is not assignable to "chainlit.step.Step" (reportArgumentType)
chainlit/backend/chainlit/data/literalai.py:367:44 - error: Argument of type "Step" cannot be assigned to parameter "step" of type "Step" in function "stub_step"
    "literalai.observability.step.Step" is not assignable to "chainlit.step.Step" (reportArgumentType)

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Sep 30, 2024
@dokterbob dokterbob force-pushed the literalai_0_0_623 branch 2 times, most recently from 10090ef to 0cfa1bf Compare September 30, 2024 17:06
dokterbob and others added 6 commits October 2, 2024 10:29
…e exceptions.

- Create LiteralToChainlitConverter class for handling conversions
- Implement methods for converting steps, threads, and attachments
- Add support for different Element subclasses based on metadata
- Allow manual setting of thread_id and id for Step and Element
@dokterbob
Copy link
Collaborator Author

Got the following error report: message.txt

To reproduce set a literal api key, setup dummy auth like

@cl.password_auth_callback
def auth_callback(username: str, password: str):
    # Fetch the user matching username from your database
    # and compare the hashed password with the value stored in the database
    if (username, password) == ("admin", "admin"):
        return cl.User(
            identifier="admin", display_name="toto", metadata={"role": "admin", "provider": "credentials"}
        )
    else:
        return None

create a conversation with an image, refresh the page and try to load it from the history
On literal everything is showing up nicely, this is purely a python error at fetching time

@dokterbob
Copy link
Collaborator Author

dokterbob commented Oct 2, 2024

Got the following error report: message.txt

To reproduce set a literal api key, setup dummy auth like

@cl.password_auth_callback
def auth_callback(username: str, password: str):
    # Fetch the user matching username from your database
    # and compare the hashed password with the value stored in the database
    if (username, password) == ("admin", "admin"):
        return cl.User(
            identifier="admin", display_name="toto", metadata={"role": "admin", "provider": "credentials"}
        )
    else:
        return None

create a conversation with an image, refresh the page and try to load it from the history On literal everything is showing up nicely, this is purely a python error at fetching time

Just replicated this with a .txt file attachment. With pure text it seems to work fine.

@dokterbob dokterbob changed the title Bump LiteralAI to 0.0.623 Bump LiteralAI version Oct 2, 2024
Copy link
Collaborator

@willydouhard willydouhard left a comment

Choose a reason for hiding this comment

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

Tested, the attachment bug is fixed!

@dokterbob dokterbob merged commit a0a8fa7 into main Oct 2, 2024
16 checks passed
@dokterbob dokterbob deleted the literalai_0_0_623 branch October 2, 2024 14:08
dokterbob added a commit that referenced this pull request Oct 2, 2024
* Bump LiteralAI dependency, update related imports.
* Cleanup and organize imports from SQLAlchemy tests.
* Extensive unittest coverage  for LiteralDataLayer.
* Consistent LiteralAI to Chainlit conversion, resolve PaginatedResponse exceptions.
* LiteralToChainlitConverter class for handling conversions, methods for converting steps, threads, and attachments.
* Allow manual setting of thread_id and id for Step and Element

---------

Co-authored-by: EWouters <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Pertains to the Python backend. review-me Ready for review! size:XXL This PR changes 1000+ lines, ignoring generated files. unit-tests Has unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants