mirror of
https://github.com/aljazceru/dev-gpt.git
synced 2025-12-20 23:24:20 +01:00
docs: implement feedback
This commit is contained in:
@@ -69,7 +69,7 @@ class _GPTConversation:
|
||||
model_name=model,
|
||||
streaming=True,
|
||||
callback_manager=CallbackManager([AssistantStreamingStdOutCallbackHandler()]),
|
||||
verbose=os.environ['VERBOSE'].lower() == 'true',
|
||||
verbose=True,
|
||||
temperature=0,
|
||||
)
|
||||
self.messages: List[BaseMessage] = []
|
||||
|
||||
@@ -65,10 +65,8 @@ def generate(
|
||||
|
||||
from src.options.generate.generator import Generator
|
||||
generator = Generator(description, test, model=model)
|
||||
with get_openai_callback() as cb:
|
||||
generator.generate(path)
|
||||
# print(f"Prompt/Completion/Total Tokens: {cb.prompt_tokens}/{cb.completion_tokens}/{cb.total_tokens}")
|
||||
# print(f"Total Cost on OpenAI (USD): ${cb.total_cost}")
|
||||
generator.generate(path)
|
||||
|
||||
|
||||
@main.command()
|
||||
@path_param
|
||||
|
||||
@@ -53,14 +53,14 @@ metas:
|
||||
return all_microservice_files_string.strip()
|
||||
|
||||
|
||||
def generate_and_persist_file(self, section_title, template, destination_folder, file_name, **kwargs):
|
||||
def generate_and_persist_file(self, section_title, template, destination_folder, file_name, **template_kwargs):
|
||||
print_colored('', f'\n############# {section_title} #############', 'blue')
|
||||
conversation = self.gpt_session.get_conversation()
|
||||
kwargs = {k: v for k, v in kwargs.items() if k in template.input_variables}
|
||||
template_kwargs = {k: v for k, v in template_kwargs.items() if k in template.input_variables}
|
||||
content_raw = conversation.chat(
|
||||
template.format(
|
||||
file_name=file_name,
|
||||
**kwargs
|
||||
**template_kwargs
|
||||
)
|
||||
)
|
||||
content = self.extract_content_from_result(content_raw, file_name, match_single_block=True)
|
||||
|
||||
Reference in New Issue
Block a user