Skip to content

Commit

Permalink
Fix defaults for serp_search_type and serp_search_location
Browse files Browse the repository at this point in the history
  • Loading branch information
nikochiko committed Sep 13, 2024
1 parent a38ad6a commit 25abd67
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 15 deletions.
6 changes: 1 addition & 5 deletions daras_ai_v2/serp_search_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def serp_search_location_selectbox(key="serp_search_location"):
options=[e.api_value for e in SerpSearchLocations],
format_func=lambda e: f"{SerpSearchLocations.from_api(e).label} ({e})",
key=key,
value=SerpSearchLocations.UNITED_STATES.name,
value=SerpSearchLocations.UNITED_STATES.api_value,
)


Expand All @@ -58,10 +58,6 @@ class SerpSearchType(GooeyEnum):
def label(self):
return self.value

@property
def api_value(self):
return self.name


class SerpSearchLocation(typing.NamedTuple):
api_value: str
Expand Down
4 changes: 2 additions & 2 deletions recipes/GoogleGPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class GoogleGPTPage(BasePage):
keywords="outdoor rugs,8x10 rugs,rug sizes,checkered rugs,5x7 rugs",
title="Ruggable",
company_url="https://ruggable.com",
serp_search_type=SerpSearchType.search,
serp_search_location=SerpSearchLocations.UNITED_STATES.name,
serp_search_type=SerpSearchType.search.name,
serp_search_location=SerpSearchLocations.UNITED_STATES.api_value,
enable_html=False,
selected_model=LargeLanguageModels.text_davinci_003.name,
sampling_temperature=0.8,
Expand Down
4 changes: 2 additions & 2 deletions recipes/GoogleImageGen.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class GoogleImageGenPage(BasePage):
sd_2_upscaling=False,
seed=42,
image_guidance_scale=1.2,
serp_search_type=SerpSearchType.search,
serp_search_location=SerpSearchLocations.UNITED_STATES.name,
serp_search_type=SerpSearchType.search.name,
serp_search_location=SerpSearchLocations.UNITED_STATES.api_value,
)

class RequestModel(GoogleSearchLocationMixin, BasePage.RequestModel):
Expand Down
4 changes: 2 additions & 2 deletions recipes/RelatedQnA.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class RelatedQnAPage(BasePage):
max_context_words=200,
scroll_jump=5,
dense_weight=1.0,
serp_search_type=SerpSearchType.search,
serp_search_location=SerpSearchLocations.UNITED_STATES.name,
serp_search_type=SerpSearchType.search.name,
serp_search_location=SerpSearchLocations.UNITED_STATES.api_value,
)

class RequestModel(GoogleGPTPage.RequestModel):
Expand Down
4 changes: 2 additions & 2 deletions recipes/RelatedQnADoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class RelatedQnADocPage(BasePage):
sane_defaults = dict(
citation_style=CitationStyles.number.name,
dense_weight=1.0,
serp_search_type=SerpSearchType.search,
serp_search_location=SerpSearchLocations.UNITED_STATES.name,
serp_search_type=SerpSearchType.search.name,
serp_search_location=SerpSearchLocations.UNITED_STATES.api_value,
)

class RequestModel(GoogleSearchMixin, DocSearchPage.RequestModel):
Expand Down
4 changes: 2 additions & 2 deletions recipes/SEOSummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def preview_description(self, state: dict) -> str:
keywords="outdoor rugs,8x10 rugs,rug sizes,checkered rugs,5x7 rugs",
title="Ruggable",
company_url="https://ruggable.com",
serp_search_type=SerpSearchType.search,
serp_search_location=SerpSearchLocations.UNITED_STATES.name,
serp_search_type=SerpSearchType.search.name,
serp_search_location=SerpSearchLocations.UNITED_STATES.api_value,
enable_html=False,
selected_model=LargeLanguageModels.text_davinci_003.name,
sampling_temperature=0.8,
Expand Down

0 comments on commit 25abd67

Please sign in to comment.