Skip to content

Forum in maintenance, we will back soon 🙂

Help me solve an er...
 
Notifications
Clear all

Help me solve an error......

5 Posts
3 Users
0 Reactions
439 Views
(@geonho-park)
Posts: 4
Active Member Customer
Topic starter
 

This is my code for 'Prompting in Action' part. 

---chatgpt.py

import helpers
import llm
from Prompts import Ideas
selected_model='gpt-3.5-turbo-0613'
input_text='no code tools'

prompt=Ideas.domain_brand_names.format(Niche=input_text)
token_count=helpers.count_tokens(prompt, selected_model)
estimated_cost=helpers.estimate_input_cost(selected_model, token_count)
print('Cost: {0}'.format(estimated_cost))

response=llm.llm_generate_text(prompt, 'OpenAI', selected_model)

print('Result:')
print(response)
---
 
 
---Errorcode
File "/Users/geonhopark/Desktop/Python/PythonWorkSpace/chatgpt.py", line 9, in <module>
prompt = Ideas.domain_brand_names.format(Niche=input_text)
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'Prompts.Ideas' has no attribute 'domain_brand_names'
---
 
 
I have asked to GPT and changed my codes, but the error keeps coming out. Please help me.
 
Posted : 09/03/2023 5:31 am
(@husein)
Posts: 531
Member Moderator
 

As the error implies " module 'Prompts.Ideas' has no attribute 'domain_brand_names' " , it states that domain_brand_names is not in the module/file "ideas". So, please provide me with a screenshot of both files "prompts" and "ideas".

 
Posted : 09/03/2023 8:46 am
(@geonho-park)
Posts: 4
Active Member Customer
Topic starter
 
I have wrote same code with you, but I still don't understand why there's an error.....
 
 
 
---
domain_brand_names = '''
Generate 10 original and creative .com domain names tailored to a specific niche and provide a brief explanation
(1-2 sentences) for each domain name, explaining its relevance and appeal to the niche. Include popular keywords
associated with the niche in your explanation to enhance marketability. The niche you'll be focusing on is [{Niche}].

Please ensure the domain names can feature a combination of words and numbers, allowing for unique and memorable options.
Emphasize creating domain names that are engaging, relevant, and aligned with the target audience's interests.
Also, consider how each domain name could benefit and resonate with the target audience. Remember to aim for
creativity and flexibility in your domain name selections.
'''
This post was modified 1 year ago by GeonHo Park
 
Posted : 09/03/2023 10:46 am
(@geonho-park)
Posts: 4
Active Member Customer
Topic starter
 

I didn't save the file of 'Ideas.py'...... Thank you for your fast answer!

 
Posted : 09/03/2023 11:16 am
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

Please create a Github project for your code with a publicly viewable link so that we can review and help.

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 09/03/2023 1:25 pm
Share: