Skip to content

Commit

Permalink
Merge branch 'main' into contribution-points-1
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoMcCabe committed Oct 30, 2023
2 parents eedc1bc + 2a66dd5 commit bba938b
Show file tree
Hide file tree
Showing 9 changed files with 381 additions and 320 deletions.
14 changes: 7 additions & 7 deletions docs/api_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ Functions
cli.file_selector.gui_file_selector
cli.file_selector.is_in_ignoring_extensions
cli.file_selector.terminal_file_selector
cli.learning.ask_if_can_store
cli.learning.check_consent
cli.learning.collect_consent
cli.learning.ask_collection_consent
cli.learning.check_collection_consent
cli.learning.extract_learning
cli.learning.get_session
cli.learning.human_review_input
cli.learning.logs_to_string
cli.main.load_env_if_needed
cli.main.load_prompt
cli.main.main
cli.main.preprompts_path

Expand Down Expand Up @@ -70,15 +70,15 @@ Functions
.. autosummary::
:toctree: core

core.ai.create_chat_model
core.ai.fallback_model
core.ai.get_tokenizer
core.ai.serialize_messages
core.chat_to_files.apply_edits
core.chat_to_files.format_file_to_input
core.chat_to_files.get_code_strings
core.chat_to_files.overwrite_files
core.chat_to_files.overwrite_files_with_edits
core.chat_to_files.parse_chat
core.chat_to_files.parse_edits
core.chat_to_files.to_files
core.chat_to_files.to_files_and_memory
core.db.archive
core.steps.assert_files_ready
core.steps.clarify
Expand Down
6 changes: 0 additions & 6 deletions docs/intro/ai_class.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,4 @@ The AI class is the main interface to the GPT-4 model. It provides methods to st

`start(self, system, user)`: This method starts a conversation with the AI. It takes a system message and a user message as arguments, and returns the AI's response.

`fsystem(self, msg)`: This method formats a system message. It takes a message as an argument and returns a dictionary with the role set to "system" and the content set to the message.

`fuser(self, msg)`: This method formats a user message. It takes a message as an argument and returns a dictionary with the role set to "user" and the content set to the message.

`fassistant(self, msg)`: This method formats an assistant message. It takes a message as an argument and returns a dictionary with the role set to "assistant" and the content set to the message.

`next(self, messages: list[dict[str, str]], prompt=None)`: This method continues a conversation with the AI. It takes a list of messages and an optional prompt as arguments, and returns the AI's response.
5 changes: 3 additions & 2 deletions gpt_engineer/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def main(
StepsConfig.USE_FEEDBACK,
StepsConfig.EVALUATE,
StepsConfig.IMPROVE_CODE,
StepsConfig.SELF_HEAL,
]:
archive(dbs)
load_prompt(dbs)
Expand All @@ -169,12 +170,12 @@ def main(
messages = step(ai, dbs)
dbs.logs[step.__name__] = AI.serialize_messages(messages)

print("Total api cost: $ ", ai.usage_cost())
print("Total api cost: $ ", ai.token_usage_log.usage_cost())

if check_collection_consent():
collect_learnings(model, temperature, steps, dbs)

dbs.logs["token_usage"] = ai.format_token_usage_log()
dbs.logs["token_usage"] = ai.token_usage_log.format_log()


if __name__ == "__main__":
Expand Down
Loading

0 comments on commit bba938b

Please sign in to comment.