Code Monkey home page Code Monkey logo

lunary-py's People

Contributors

bsf-ks avatar erikwiffin avatar fabiobarkoski avatar haitrr avatar hughcrt avatar pandazki avatar vincelwt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lunary-py's Issues

TypeError('Object of type AIMessage is not JSON serializable

Exception: TypeError('Object of type AIMessage is not JSON serializable during sending events
Lcel chain configuration: AgentExecutor agent tool
Lunary version: 0.1.38
Langchain version: 0.1.6
Langchain-community: 0.0.19

Error in sending json:

{
      "event":"end",
      "type":"chain",
      ...
      "timestamp":"2024-02-28T11:02:02.704029+00:00",
      "message":"None",
      "input":"None",
      "output":{
         "lc":1,
         "type":"constructor",
         "id":[
            "langchain",
            "schema",
            "agent",
            "AgentFinish"
         ],
         "kwargs":{
            "return_values":{
               "output":"Test success !",
               "messages":[   <- not valid json
                  "AIMessage(content=""<FINAL_ANSWER>\nTest success !\n</FINAL_ANSWER>"")"
               ]
            },
            "log":"<FINAL_ANSWER>\nTest success !\n</FINAL_ANSWER>"
         }
      },
 ...
   }

When events stucks in EventQueue (because of error on sending events to self-hosted Lunary service) they are modified after by still running and streaming agent. Error is caused by messages are added at langchain\agents\agent_iterator.py in function _return/a_return

        returned_output["messages"] = output.messages

Solution: I think lunary.track_event should copy the output object to event making it read only

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.