From 32daa968d6496207e51c8260972b2fb5cbe9ae67 Mon Sep 17 00:00:00 2001 From: HRUSHIKESH DOKALA <96101829+Hk669@users.noreply.github.com> Date: Sat, 22 Jun 2024 00:22:23 +0530 Subject: [PATCH] fix: created in ChatCompletion for clients (#2988) --- autogen/oai/anthropic.py | 2 +- autogen/oai/gemini.py | 2 +- autogen/oai/mistral.py | 2 +- autogen/oai/together.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/autogen/oai/anthropic.py b/autogen/oai/anthropic.py index 9f9203ef2299..0bbbec3975f2 100644 --- a/autogen/oai/anthropic.py +++ b/autogen/oai/anthropic.py @@ -181,7 +181,7 @@ def create(self, params: Dict[str, Any]) -> Completion: response_oai = ChatCompletion( id=response.id, model=anthropic_params["model"], - created=int(time.time() * 1000), + created=int(time.time()), object="chat.completion", choices=choices, usage=CompletionUsage( diff --git a/autogen/oai/gemini.py b/autogen/oai/gemini.py index 30d4c3fe5180..8babb8727e3c 100644 --- a/autogen/oai/gemini.py +++ b/autogen/oai/gemini.py @@ -253,7 +253,7 @@ def create(self, params: Dict) -> ChatCompletion: response_oai = ChatCompletion( id=str(random.randint(0, 1000)), model=model_name, - created=int(time.time() * 1000), + created=int(time.time()), object="chat.completion", choices=choices, usage=CompletionUsage( diff --git a/autogen/oai/mistral.py b/autogen/oai/mistral.py index 832369376af9..8017e3536324 100644 --- a/autogen/oai/mistral.py +++ b/autogen/oai/mistral.py @@ -175,7 +175,7 @@ def create(self, params: Dict[str, Any]) -> ChatCompletion: response_oai = ChatCompletion( id=mistral_response.id, model=mistral_response.model, - created=int(time.time() * 1000), + created=int(time.time()), object="chat.completion", choices=choices, usage=CompletionUsage( diff --git a/autogen/oai/together.py b/autogen/oai/together.py index ef6c09804a46..bbbe851ba776 100644 --- a/autogen/oai/together.py +++ b/autogen/oai/together.py @@ -209,7 +209,7 @@ def create(self, params: Dict) -> ChatCompletion: response_oai = ChatCompletion( id=response.id, model=together_params["model"], - created=int(time.time() * 1000), + created=int(time.time()), object="chat.completion", choices=choices, usage=CompletionUsage(