Skip to content

Commit

Permalink
Merge pull request #17 from SebastianJames55/feature/improving_respon…
Browse files Browse the repository at this point in the history
…se_#13

- improving prompt
  • Loading branch information
SebastianJames55 authored Aug 25, 2023
2 parents 4d6570b + 5808c54 commit 9b23b5c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions connectors/mindsdb_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ def get_mindsdb_connection():
logging.debug('Connecting to mindsdb app')
return mindsdb_sdk.connect()


DB_ENGINE = 'mysql'
DB_NAME = 'mysql_demo_db'
DB_CONNECTION_ARGS = {
"user": "user",
"password": "MindsDBUser123!",
"host": "db-demo-data.cwoyhfn6bzs0.us-east-1.rds.amazonaws.com",
"password": "example",
"host": "db-demo-data.example.us-east-1.rds.amazonaws.com",
"port": "3306",
"database": "public"
}
Expand Down Expand Up @@ -49,6 +50,7 @@ def drop_database(db_name):
logging.debug('Dropping database')
server.drop_database(db_name)


PROJECT_NAME = 'mind_reader_project'


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


def drop_project(project_name):
# Get the connection lazily
server = get_mindsdb_connection()
if project_name in get_project_names(server):
logging.debug('Dropping project')
server.drop_project(project_name)


MODEL_ENGINE = 'openai'
MODEL_NAME = 'text-davinci-003'
OPENAI_API_KEY = os.environ.get('OPENAI_API_KEY')


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

0 comments on commit 9b23b5c

Please sign in to comment.