Skip to content

Commit

Permalink
Fix mutable default argument in APIRequest class
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelaconstantin committed May 23, 2023
1 parent 9f9a8d8 commit c71d7ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/api_request_parallel_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
import re # for matching endpoint from request URL
import tiktoken # for counting tokens
import time # for sleeping after rate limit is hit
from dataclasses import dataclass # for storing API inputs, outputs, and metadata
from dataclasses import dataclass, field # for storing API inputs, outputs, and metadata


async def process_api_requests_from_file(
Expand Down Expand Up @@ -258,7 +258,7 @@ class APIRequest:
request_json: dict
token_consumption: int
attempts_left: int
result = []
result: list = field(default_factory=list)

async def call_api(
self,
Expand Down

0 comments on commit c71d7ad

Please sign in to comment.