Skip to content

Commit

Permalink
fix: created in ChatCompletion for clients (#2988)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hk669 authored and victordibia committed Jul 30, 2024
1 parent 76e4b82 commit 32daa96
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion autogen/oai/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion autogen/oai/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion autogen/oai/mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion autogen/oai/together.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 32daa96

Please sign in to comment.