Skip to content

Include x-coding-assistant=open-interpreter header in litellm calls #1586

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions interpreter/core/llm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from importlib import metadata

_VERSION = "dev"


def __get_version():
try:
version = metadata.version("open-interpreter")
except metadata.PackageNotFoundError:
version = _VERSION
return version


__version__ = __get_version()
2 changes: 2 additions & 0 deletions interpreter/core/llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sys

import litellm
from . import __version__

litellm.suppress_debug_info = True
litellm.REPEATED_STREAMING_CHUNK_LIMIT = 99999999
Expand Down Expand Up @@ -437,6 +438,7 @@ def fixed_litellm_completions(**params):
first_error = None

params["num_retries"] = 0
params["headers"] = {"x-coding-assistant": f"open-interpreter/{__version__}"}

for attempt in range(attempts):
try:
Expand Down