Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 PRs #862

Merged
merged 2 commits into from
Jul 26, 2024
Merged

2 PRs #862

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions captn/captn_agents/backend/teams/_gbb_google_sheets_team.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,15 @@ def _guidelines(self) -> str:
4. Once you have the file names, you must determine the id of the Google spreadsheet template and the id of the spreadsheet with new routes.
- Use reply_to_client command to check if you found the correct files by providing the file names. Do NOT mention all the files, only the ones that are relevant.
- Do NOT forget this step, because the client needs to confirm that you have found the correct files, otherwise you will be penalized!
- ALWAYS add final sentence "If these are NOT the correct files, please paste the whole URL of the correct files."
5. In the template spreadsheet, you must must check that 'Campaigns', 'ad Groups', 'Keywords' and 'Ads' titles exist (by using 'get_all_sheet_titles_get_all_sheet_titles_get').
6. In the spreadsheet with new routes, you must find the title of the sheet with new routes (by using 'get_all_sheet_titles_get_all_sheet_titles_get').
- If there are multiple sheets within the spreadsheet, ask the client to choose the correct sheet.
7. Once you have all the necessary information, use 'process_spreadsheet_process_spreadsheet_post' endpoint to process the spreadsheet.
- query parameters: user_id, template_spreadsheet_id, new_campaign_spreadsheet_id, new_campaign_sheet_title
8. Once the endpoint is successful write the message to the client that the new sheet has been created in the same spreadsheet as the new routes sheet.
- If you are informed that the new sheet contains 'Issues' column, you must inform the client that the 'Issues' column has been added to the new sheet and that the client should check it and try to resolve it manually.
- Do NOT proceed with the next steps until the client confirms that has resolved the issues. Use only ONE smart suggestion 'I have resolved the issues' and do not offer to help with the issues because you are not experienced in that area.
9. If the user verifies that everything is correct the team should do the following:
- List accessible customers by using the 'list_accessible_customers_with_account_types' function. (this should be done by the Google_ads_expert)
- Ask the user choose the correct customer id (This should be done by the Account_manager)
Expand All @@ -127,6 +131,13 @@ def _guidelines(self) -> str:

OFTEN MISTAKES:
- Do NOT forget the 'modification_function_parameters' when calling 'ask_client_for_permission' function!
- If the client wants to change the Google Ads account or refresh token, use 'change_google_ads_account_or_refresh_token' function.
- If the client wants to change the Google Sheets account, use 'get_login_url_login_get' function with 'force_new_login' parameter set to True.

ADDITIONAL NOTES:
- ALWAYS use hyperlinks to the Google Sheets UI when referring it to the client.
e.g. "Are these the correct files?\n\n1. ROUTES: [new-routes](https://docs.google.com/spreadsheets/d/insert_correct_sheet_id) \n\n2. TEMPLATES: [template](https://docs.google.com/spreadsheets/d/insert_correct_sheet_id)"
- ALWAYS use names of the sheets and google ads customer account names when referring them to the client. You can add id-s in the brackets.
"""

@property
Expand Down Expand Up @@ -156,11 +167,14 @@ def _commands(self) -> str:


3. Only Google_sheets_expert has access to Google Sheets API and can read and edit Google Sheets.
- 'get_login_url_login_get' - which will return the login url for the Google Sheets API (This can't be used for Google Ads account)
If you want to refresh google sheets token or change google sheets use 'get_login_url_login_get' with 'force_new_login' parameter set to True.

4. Only Google_ads_expert has access to the following commands:
- 'list_accessible_customers_with_account_types' (to list accessible Google Ads customers with account types)
- 'list_sub_accounts' (to list sub-accounts of a Google Ads customer, use it if the client wants to use Manager Account)
- 'create_google_ads_resources'
- 'change_google_ads_account_or_refresh_token' - to change Google Ads account or refresh token (This can't be used for Google Sheets account)
"""

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
reply_to_client,
)
from ._google_ads_team_tools import (
change_google_account,
get_resource_id_from_response,
)

Expand Down Expand Up @@ -742,4 +743,12 @@ def create_google_sheets_team_toolbox(
create_google_ads_resources
)

change_google_ads_account_description = (
"Change Google Ads account or refresh access token"
)
toolbox.add_function(
description=change_google_ads_account_description,
name="change_google_ads_account_or_refresh_token",
)(change_google_account)

return toolbox
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ def test_init(self, mock_get_conv_uuid: Iterator[Any]) -> None:
)
agent_number_of_functions_dict = {
"google_sheets_expert": 8,
"account_manager": 5,
"google_ads_expert": 5,
"account_manager": 6,
"google_ads_expert": 6,
"user_proxy": 0,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_llm_config(self) -> None:
self.toolbox.add_to_agent(agent, user_proxy)
llm_config = agent.llm_config

check_llm_config_total_tools(llm_config, 5)
check_llm_config_total_tools(llm_config, 6)
check_llm_config_descriptions(
llm_config,
{
Expand All @@ -107,6 +107,7 @@ def test_llm_config(self) -> None:
"list_accessible_customers_with_account_types": "List accessible customers with account types",
"list_sub_accounts": "Use this function to list sub accounts of a Google Ads manager account",
"create_google_ads_resources": "Creates Google Ads resources",
"change_google_ads_account_or_refresh_token": "Change Google Ads account or refresh access token",
},
)

Expand Down
Loading