Skip to content

Commit 9b23b5c

Browse files
Merge pull request #17 from SebastianJames55/feature/improving_response_#13
- improving prompt
2 parents 4d6570b + 5808c54 commit 9b23b5c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

connectors/mindsdb_connector.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ def get_mindsdb_connection():
1010
logging.debug('Connecting to mindsdb app')
1111
return mindsdb_sdk.connect()
1212

13+
1314
DB_ENGINE = 'mysql'
1415
DB_NAME = 'mysql_demo_db'
1516
DB_CONNECTION_ARGS = {
1617
"user": "user",
17-
"password": "MindsDBUser123!",
18-
"host": "db-demo-data.cwoyhfn6bzs0.us-east-1.rds.amazonaws.com",
18+
"password": "example",
19+
"host": "db-demo-data.example.us-east-1.rds.amazonaws.com",
1920
"port": "3306",
2021
"database": "public"
2122
}
@@ -49,6 +50,7 @@ def drop_database(db_name):
4950
logging.debug('Dropping database')
5051
server.drop_database(db_name)
5152

53+
5254
PROJECT_NAME = 'mind_reader_project'
5355

5456

@@ -75,17 +77,20 @@ def get_project(project_name):
7577
logging.debug('Fetching project')
7678
return server.get_project(project_name)
7779

80+
7881
def drop_project(project_name):
7982
# Get the connection lazily
8083
server = get_mindsdb_connection()
8184
if project_name in get_project_names(server):
8285
logging.debug('Dropping project')
8386
server.drop_project(project_name)
8487

88+
8589
MODEL_ENGINE = 'openai'
8690
MODEL_NAME = 'text-davinci-003'
8791
OPENAI_API_KEY = os.environ.get('OPENAI_API_KEY')
8892

93+
8994
def get_model_names(project):
9095
logging.debug('Fetching models')
9196
return [model.name for model in project.list_models()]
@@ -104,8 +109,9 @@ def create_model(project_name, model_name):
104109
'prompt_template': '''
105110
Reply like a friend who cares and wants to help.
106111
Input message: {{text}}
107-
In less than 550 characters, when there's some sign of distress provide a Share healthy habits, motivational quotes, inspirational
108-
real-life stories. Provide options to seek out in-person help if you aren't able to satisfy.
112+
In less than 550 characters, when there's some sign of distress in the input share healthy habits,
113+
motivational quotes, inspirational real-life stories.
114+
Provide options to seek out in-person help if you aren't able to satisfy.
109115
''',
110116
'max_tokens': 300
111117
}

0 commit comments

Comments
 (0)