File size: 5,508 Bytes
825865b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
��e:\Git\Final_Assignment_Template\.venv\Scripts\python.exe : 

USER_AGENT environment variable not set, consider setting 

it to identify your requests.

At line:1 char:1

+ e:\Git\Final_Assignment_Template\.venv\Scripts\python.exe 

e:\Git\Fina ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (USER_AGENT env 

   i... your requests.:String) [], RemoteException

    + FullyQualifiedErrorId : NativeCommandError

 

Traceback (most recent call last):

  File "C:\Users\Admin\AppData\Roaming\uv\python\cpython-3.1

2.12-windows-x86_64-none\Lib\unittest\mock.py", line 1581, 

in __enter__

    setattr(self.target, self.attribute, new_attr)

  File "E:\Git\Final_Assignment_Template\.venv\Lib\site-pack

ages\pydantic\main.py", line 1032, in __setattr__

    elif (setattr_handler := self._setattr_handler(name, 

value)) is not None:

                             

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "E:\Git\Final_Assignment_Template\.venv\Lib\site-pack

ages\pydantic\main.py", line 1079, in _setattr_handler

    raise ValueError(f'"{cls.__name__}" object has no field 

"{name}"')

ValueError: "ChatOpenAI" object has no field "invoke"



During handling of the above exception, another exception 

occurred:



Traceback (most recent call last):

  File "E:\Git\Final_Assignment_Template\.venv\Lib\site-pack

ages\pydantic\main.py", line 1119, in __delattr__

    object.__delattr__(self, item)

AttributeError: 'ChatOpenAI' object has no attribute 

'invoke'



During handling of the above exception, another exception 

occurred:



Traceback (most recent call last):

  File 

"e:\Git\Final_Assignment_Template\verify_fallback.py", line 

62, in <module>

    test_fallback_logic()

  File 

"e:\Git\Final_Assignment_Template\verify_fallback.py", line 

28, in test_fallback_logic

    with patch('agent.openrouter_model.invoke') as 

mock_openrouter, \

         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\Admin\AppData\Roaming\uv\python\cpython-3.1

2.12-windows-x86_64-none\Lib\unittest\mock.py", line 1594, 

in __enter__

    if not self.__exit__(*sys.exc_info()):

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\Admin\AppData\Roaming\uv\python\cpython-3.1

2.12-windows-x86_64-none\Lib\unittest\mock.py", line 1605, 

in __exit__

    delattr(self.target, self.attribute)

  File "E:\Git\Final_Assignment_Template\.venv\Lib\site-pack

ages\pydantic\main.py", line 1121, in __delattr__

    raise AttributeError(f'{type(self).__name__!r} object 

has no attribute {item!r}')

AttributeError: 'ChatOpenAI' object has no attribute 

'invoke'

Testing fallback logic...

Test failed: 'ChatOpenAI' object has no attribute 'invoke'