Classes:
MissingAPIKeyError: Inherits fromValueError. Represents an error when the API key is missing.ExhaustedContextWindow: Inherits fromException. Represents an error when the context window is exhausted.Coder: The main class representing the Coder functionality.
Functions:
wrap_fence(name): Returns a tuple of opening and closing fence tags for the given name.Coder.create(...): A class method to create an instance of the Coder class based on the provided parameters.Coder.__init__(...): The constructor method for the Coder class, initializing various attributes.Coder.show_announcements(): Displays announcement messages.Coder.find_common_root(): Finds the common root directory for the files.Coder.add_rel_fname(rel_fname): Adds a relative file name to the set of absolute file names.Coder.drop_rel_fname(fname): Drops a relative file name from the set of absolute file names.Coder.abs_root_path(path): Returns the absolute path relative to the root directory.Coder.show_pretty(): Determines whether to show pretty output based on the fence format.Coder.get_abs_fnames_content(): Yields the content of absolute file names.Coder.choose_fence(): Chooses the appropriate fence format based on the file content.Coder.get_files_content(fnames=None): Returns the content of the specified files or all files.Coder.get_repo_map(): Returns the repository map content.Coder.get_files_messages(): Returns the messages related to the files.Coder.get_images_message(): Returns the message related to image files.Coder.run_stream(user_message): Runs the Coder in streaming mode with the given user message.Coder.run(with_message=None): Runs the Coder with an optional message.Coder.run_loop(): Runs the main loop of the Coder.Coder.keyboard_interrupt(): Handles keyboard interrupts.Coder.summarize_start(): Starts the summarization process.Coder.summarize_worker(): Worker function for summarization.Coder.summarize_end(): Ends the summarization process.Coder.move_back_cur_messages(message): Moves the current messages back to the done messages.Coder.fmt_system_prompt(prompt): Formats the system prompt.Coder.format_messages(): Formats the messages for the Coder.Coder.send_new_user_message(inp): Sends a new user message to the Coder.Coder.update_cur_messages(edited): Updates the current messages based on the edited files.Coder.check_for_file_mentions(content): Checks for file mentions in the content and adds them to the chat.Coder.send(messages, model=None, functions=None): Sends messages to the model and handles the response.Coder.show_send_output(completion): Shows the output of the send operation.Coder.show_send_output_stream(completion): Shows the output of the send operation in streaming mode.Coder.live_incremental_response(mdstream, final): Renders the incremental response in real-time.Coder.render_incremental_response(final): Renders the incremental response.Coder.get_rel_fname(fname): Returns the relative file name.Coder.get_inchat_relative_files(): Returns the relative file names in the chat.Coder.get_all_relative_files(): Returns all relative file names.Coder.get_all_abs_files(): Returns all absolute file names.Coder.get_last_modified(): Returns the last modified timestamp of the files.Coder.get_addable_relative_files(): Returns the relative file names that can be added to the chat.Coder.check_for_dirty_commit(path): Checks if a file needs a dirty commit before applying edits.Coder.allowed_to_edit(path): Checks if a file is allowed to be edited.Coder.check_added_files(): Checks the number of added files and warns if necessary.Coder.prepare_to_edit(edits): Prepares the files for editing.Coder.update_files(): Updates the files based on the edits.Coder.apply_updates(): Applies the updates to the files.Coder.parse_partial_args(): Parses the partial arguments from the response.Coder.get_context_from_history(history): Returns the context from the chat history.Coder.auto_commit(edited): Automatically commits the edited files.Coder.dirty_commit(): Performs a dirty commit if necessary.