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

Bug:tutorial/custom_user_interactions exception on function call #195

Open
davorinrusevljan opened this issue Sep 12, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@davorinrusevljan
Copy link
Collaborator

Describe the bug
when running tutorial custom_user_interaction

exception occurs when calling function:

fastagency run docs/docs_src/tutorial/custom_user_interactions/main.py

   126 │   │   │   if self.type == "suggested_function_call":                                                            │
│   127 │   │   │   │   # logger.info("CurrentMessage.process_chunk(): parsing arguments")                                │128 │   │   │   │   arguments_json: str = _findall("arguments", chunk)  # type: ignore[assig                          │
│ ❱ 129 │   │   │   │   self.arguments = json.loads(arguments_json)                                                       │
│   130 │   │   │   elif self.type == "function_call_execution":                                                          │
│   131 │   │   │   │   # logger.info("CurrentMessage.process_chunk(): parsing retval")                                   │132 │   │   │   │   self.retval = chunk                                                                               │
│                                                                                                                         │
│ ╭────────────────────────────────────────────────────── locals ───────────────────────────────────────────────────────╮ │
│ │ arguments_json = ()                                                                                                 │ │
│ │          chunk = '\x1b[32m***************************************************************************'+10           │ │
│ │           self = CurrentMessage(                                                                                    │ │
│ │                  │   sender='Student_Agent',                                                                        │ │
│ │                  │   recipient='Teacher_Agent',                                                                     │ │
│ │                  │   type='suggested_function_call',                                                                │ │
│ │                  │   auto_reply=False,                                                                              │ │
│ │                  │   body=None,                                                                                     │ │
│ │                  │   call_id='call_PNlOdOlRSQxkgIRpWk5U8hc3',                                                       │ │
│ │                  │   function_name='get_final_grade',                                                               │ │
│ │                  │   arguments={                                                                                    │ │
│ │                  │   │   'message': 'Please provide the final grade for my answers regarding the Mona Lisa.'        │ │
│ │                  │   },                                                                                             │ │
│ │                  │   retval=None                                                                                    │ │
│ │                  )                                                                                                  │ │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                         │
│ /usr/local/lib/python3.11/json/__init__.py:339 in loads                                                                 │
│                                                                                                                         │
│   336 │   │   │   │   │   │   │   │     s, 0)                                                                           │
│   337else:                                                                                                         │
│   338 │   │   if not isinstance(s, (bytes, bytearray)):                                                                 │
│ ❱ 339 │   │   │   raise TypeError(f'the JSON object must be str, bytes or bytearray, '                                  │
│   340 │   │   │   │   │   │   │   f'not {s.__class__.__name__}')                                                        │
│   341 │   │   s = s.decode(detect_encoding(s), 'surrogatepass')                                                         │
│   342                                                                                                                   │
│                                                                                                                         │
│ ╭───────── locals ─────────╮                                                                                            │
│ │               cls = None │                                                                                            │
│ │                kw = {}   │                                                                                            │
│ │       object_hook = None │                                                                                            │
│ │ object_pairs_hook = None │                                                                                            │
│ │    parse_constant = None │                                                                                            │
│ │       parse_float = None │                                                                                            │
│ │         parse_int = None │                                                                                            │
│ │                 s = ()   │                                                                                            │
│ ╰──────────────────────────╯                                                                                            │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: the JSON object must be str, bytes or bytearray, not tuple
@davorinrusevljan davorinrusevljan added the bug Something isn't working label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants