You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I attempted to run the routine for the custom model, which is supposed to just echo back what the user said, but it was not successful.
def custom_language_model(openai_message):
"""
OpenAI-compatible completions function (this one just echoes what the user said back).
"""
users_content = openai_message[-1].get("content") # Get last message's content
# To make it OpenAI-compatible, we yield this first:
yield {"delta": {"role": "assistant"}}
for character in users_content:
yield {"delta": {"content": character}}
# Tell Open Interpreter to power the language model with this function
interpreter.llm.completion = custom_language_model
I attempted to make modifications to interpreter.llm.completions = custom_language_model
But the parameters don't match up.
Reproduce
Run
def custom_language_model(openai_message):
"""
OpenAI-compatible completions function (this one just echoes what the user said back).
"""
users_content = openai_message[-1].get("content") # Get last message's content
# To make it OpenAI-compatible, we yield this first:
yield {"delta": {"role": "assistant"}}
for character in users_content:
yield {"delta": {"content": character}}
# Tell Open Interpreter to power the language model with this function
interpreter.llm.completion = custom_language_model
defcustom_language_model(**params):
""" OpenAI-compatible completions function (this one just echoes what the user said back). """openai_message=params['messages']
users_content=openai_message[-1].get("content")
# To make it OpenAI-compatible, we yield this first:yield {"delta": {"role": "assistant"}}
forcharacterinusers_content:
yield {"delta": {"content": character}}
Describe the bug
I attempted to run the routine for the custom model, which is supposed to just echo back what the user said, but it was not successful.
I attempted to make modifications to
interpreter.llm.completions = custom_language_model
But the parameters don't match up.
Reproduce
Run
https://docs.openinterpreter.com/language-models/custom-models
Expected behavior
(this one just echoes what the user said back)
Screenshots
No response
Open Interpreter version
0.2.4
Python version
3.11
Operating System name and version
win 11
Additional context
No response
The text was updated successfully, but these errors were encountered: