Skip to content

Sourcery refactored main branch#3

Open
sourcery-ai[bot] wants to merge 1 commit into
mainfrom
sourcery/main
Open

Sourcery refactored main branch#3
sourcery-ai[bot] wants to merge 1 commit into
mainfrom
sourcery/main

Conversation

@sourcery-ai

@sourcery-ai sourcery-ai Bot commented May 12, 2023

Copy link
Copy Markdown

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai Bot requested a review from Bradybry May 12, 2023 21:09
}

def get_content(self):
def get_content(self):

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function LanguageExpert.get_content refactored with the following changes:

Comment on lines -326 to -343

# Extract the role (as name), system_message, example_input, and example_output from the markdown text
name = name_pattern.search(markdown_text).group(1).strip()
role = role_pattern.search(markdown_text).group(1).strip()
system_message = system_message_pattern.search(markdown_text).group(1).strip()
example_input = example_input_pattern.search(markdown_text).group(1).strip()
example_output = example_output_pattern.search(markdown_text).group(1).strip()

# Create a dictionary with the extracted information, using key names matching the original JSON-like dictionary
assistant_definition = {
name = name_pattern.search(markdown_text)[1].strip()
role = role_pattern.search(markdown_text)[1].strip()
system_message = system_message_pattern.search(markdown_text)[1].strip()
example_input = example_input_pattern.search(markdown_text)[1].strip()
example_output = example_output_pattern.search(markdown_text)[1].strip()

return {
'name': name,
'description': role,
'system_message': system_message,
'example_input': example_input,
'example_output': example_output
'example_output': example_output,
}

return assistant_definition

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parse_assistant_definition refactored with the following changes:

This removes the following comments ( why? ):

# Create a dictionary with the extracted information, using key names matching the original JSON-like dictionary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants