File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,10 +156,6 @@ def run_text_prompt(
156156 model : str = DEFAULT_MODEL ,
157157) -> TextPromptResponse :
158158 """Run a text prompt."""
159- # Maritime: Skip OpenAI calls unless text contains "IMO"
160- if "imo" not in string .lower ():
161- log .info ("Skipping GPT (no IMO): %s" % string [:50 ])
162- return {}
163159 client = get_client ()
164160 cache_hash = sha1 (string .encode ("utf-8" ))
165161 cache_hash .update (prompt .encode ("utf-8" ))
@@ -169,6 +165,10 @@ def run_text_prompt(
169165 log .info ("GPT cache hit: %s" % string [:50 ])
170166 return TextPromptResponse (content = cached_data , cache_key = cache_key )
171167 log .info ("Prompting %r for: %s" % (model , string [:50 ]))
168+ # Maritime: Skip OpenAI calls unless text contains "IMO"
169+ if "imo" not in string .lower ():
170+ log .info ("Skipping GPT (no IMO): %s" % string [:50 ])
171+ return TextPromptResponse (content = string , cache_key = cache_key )
172172 response = client .chat .completions .create (
173173 model = model ,
174174 messages = [
You can’t perform that action at this time.
0 commit comments