Skip to content

Instantly share code, notes, and snippets.

@paralin
Created May 4, 2024 19:47
Show Gist options
  • Save paralin/1af13c131ed4484ff9f13fb058cf7772 to your computer and use it in GitHub Desktop.
Save paralin/1af13c131ed4484ff9f13fb058cf7772 to your computer and use it in GitHub Desktop.
aider coder overview

Classes:

  1. MissingAPIKeyError: Inherits from ValueError. Represents an error when the API key is missing.
  2. ExhaustedContextWindow: Inherits from Exception. Represents an error when the context window is exhausted.
  3. Coder: The main class representing the Coder functionality.

Functions:

  1. wrap_fence(name): Returns a tuple of opening and closing fence tags for the given name.
  2. Coder.create(...): A class method to create an instance of the Coder class based on the provided parameters.
  3. Coder.__init__(...): The constructor method for the Coder class, initializing various attributes.
  4. Coder.show_announcements(): Displays announcement messages.
  5. Coder.find_common_root(): Finds the common root directory for the files.
  6. Coder.add_rel_fname(rel_fname): Adds a relative file name to the set of absolute file names.
  7. Coder.drop_rel_fname(fname): Drops a relative file name from the set of absolute file names.
  8. Coder.abs_root_path(path): Returns the absolute path relative to the root directory.
  9. Coder.show_pretty(): Determines whether to show pretty output based on the fence format.
  10. Coder.get_abs_fnames_content(): Yields the content of absolute file names.
  11. Coder.choose_fence(): Chooses the appropriate fence format based on the file content.
  12. Coder.get_files_content(fnames=None): Returns the content of the specified files or all files.
  13. Coder.get_repo_map(): Returns the repository map content.
  14. Coder.get_files_messages(): Returns the messages related to the files.
  15. Coder.get_images_message(): Returns the message related to image files.
  16. Coder.run_stream(user_message): Runs the Coder in streaming mode with the given user message.
  17. Coder.run(with_message=None): Runs the Coder with an optional message.
  18. Coder.run_loop(): Runs the main loop of the Coder.
  19. Coder.keyboard_interrupt(): Handles keyboard interrupts.
  20. Coder.summarize_start(): Starts the summarization process.
  21. Coder.summarize_worker(): Worker function for summarization.
  22. Coder.summarize_end(): Ends the summarization process.
  23. Coder.move_back_cur_messages(message): Moves the current messages back to the done messages.
  24. Coder.fmt_system_prompt(prompt): Formats the system prompt.
  25. Coder.format_messages(): Formats the messages for the Coder.
  26. Coder.send_new_user_message(inp): Sends a new user message to the Coder.
  27. Coder.update_cur_messages(edited): Updates the current messages based on the edited files.
  28. Coder.check_for_file_mentions(content): Checks for file mentions in the content and adds them to the chat.
  29. Coder.send(messages, model=None, functions=None): Sends messages to the model and handles the response.
  30. Coder.show_send_output(completion): Shows the output of the send operation.
  31. Coder.show_send_output_stream(completion): Shows the output of the send operation in streaming mode.
  32. Coder.live_incremental_response(mdstream, final): Renders the incremental response in real-time.
  33. Coder.render_incremental_response(final): Renders the incremental response.
  34. Coder.get_rel_fname(fname): Returns the relative file name.
  35. Coder.get_inchat_relative_files(): Returns the relative file names in the chat.
  36. Coder.get_all_relative_files(): Returns all relative file names.
  37. Coder.get_all_abs_files(): Returns all absolute file names.
  38. Coder.get_last_modified(): Returns the last modified timestamp of the files.
  39. Coder.get_addable_relative_files(): Returns the relative file names that can be added to the chat.
  40. Coder.check_for_dirty_commit(path): Checks if a file needs a dirty commit before applying edits.
  41. Coder.allowed_to_edit(path): Checks if a file is allowed to be edited.
  42. Coder.check_added_files(): Checks the number of added files and warns if necessary.
  43. Coder.prepare_to_edit(edits): Prepares the files for editing.
  44. Coder.update_files(): Updates the files based on the edits.
  45. Coder.apply_updates(): Applies the updates to the files.
  46. Coder.parse_partial_args(): Parses the partial arguments from the response.
  47. Coder.get_context_from_history(history): Returns the context from the chat history.
  48. Coder.auto_commit(edited): Automatically commits the edited files.
  49. Coder.dirty_commit(): Performs a dirty commit if necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment