codelion / optillm

Optimizing inference proxy for LLMs
Apache License 2.0
1.64k stars 130 forks source link

parse conversation reports error #84

Closed femto closed 2 weeks ago

femto commented 3 weeks ago

Hello, I'm using ell, and parse_conversation(messages) reports error:

File "/Users/femtozheng/python-project/optillm/optillm.py", line 288, in extract_optillm_approach
    match = re.search(r'<optillm_approach>(.*?)</optillm_approach>', content)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/.pyenv/versions/3.11.4/lib/python3.11/re/__init__.py", line 176, in search
    return _compile(pattern, flags).search(string)

I believe it's passing complex content(so to support image etc on one message) [{'text': '....', 'type': 'text'}]