Skip to content

Question About GPT_Structured_Request and IndexError Bug #50

@Cyan9644

Description

@Cyan9644

Hi @chowington ,

I noticed that there is no call to the update_cost method (from openai_logger_singleton) in the GPT_Structured_Request function (persona/prompt_template/gpt_structure); this uses the same framework as ChatGPT_Structured_Request, which does have the call to the logger. This function is used indirectly in multiple places, including with long prompts like generate_focal_pt_v1. Not sure if I'm this is unintended or I'm just missing something, but I thought I'd ask. On a related note, I found that there is a bug in safe_generate_structured_response where on long (350+ step) runs, the agents will sometimes mistakenly generate incomplete plans. I don't know why this happens, but it is easily fixed with regex as shown below in case anyone else has experienced this too. Thanks!

if(isinstance(response_format, NewSchedule)):
delimiters = ["pm", "am", "PM", "Pm", "P.M", "p.m", "P.m", "AM", "Am", "A.M", "A.m", "A.m"]
regex = map(re.escape, delimiters)
regex_pattern = '|'.join(regex)
splitter = re.split(regex_pattern, str(curr_gpt_response))
if(endtime is not None):
if not(endtime in (splitter[-1])):

        ...

       ( i-=1
        time.sleep(1)
        continue)

Edit: Cost Logger is correct as is according to API statistics

Cyan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions