This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #rds | |
| rds = boto3.client('rds', region_name='us-east-1') | |
| # Obtenemos una lista de todas las instancias RDS | |
| rds_instances = rds.describe_db_instances() | |
| stopRdsInstances = [] | |
| #recorremos las instancias y filtramos por tag | |
| for rds_instance in rds_instances["DBInstances"]: | |
| tags = rds.list_tags_for_resource(ResourceName=rds_instance["DBInstanceArn"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Definimos nuestro tag | |
| tag_name = 'Staging' | |
| #instancias EC2 | |
| ec2 = boto3.resource('ec2', region_name='us-east-1') | |
| instances = ec2.instances.filter(Filters=[ | |
| { | |
| 'Name': 'instance-state-name', | |
| 'Values': ['stopped'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const completion = await openai.createCompletion({ | |
| model: "code-davinci-002", | |
| prompt: one_shot_text, | |
| temperature: 0, | |
| max_tokens: 100, | |
| top_p: 1.0, | |
| frequency_penalty: 0.5, | |
| presence_penalty: 0.0, | |
| stop: ["Bot:", "Me:"], | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const completion = await openai.createCompletion({ | |
| model: "code-cushman-001", | |
| prompt: one_shot_text, | |
| temperature: 0, | |
| max_tokens: 100, | |
| top_p: 1.0, | |
| frequency_penalty: 0.5, | |
| presence_penalty: 0.0, | |
| stop: ["Bot:"], | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const completion = await openai.createCompletion({ | |
| model: "text-davinci-003", | |
| prompt: one_shot_text, | |
| temperature: 0, | |
| max_tokens: 60, | |
| top_p: 1.0, | |
| frequency_penalty: 0.5, | |
| presence_penalty: 0.0, | |
| stop: ["Bot:"], | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const completion = await openai.createCompletion({ | |
| model: "text-curie-001", | |
| prompt: one_shot_text, | |
| temperature: 0, | |
| max_tokens: 60, | |
| top_p: 1.0, | |
| frequency_penalty: 0.5, | |
| presence_penalty: 0.0, | |
| stop: ["."], | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const completion = await openai.createCompletion({ | |
| model: "text-babbage-001", | |
| prompt: one_shot_text, | |
| temperature: 0, | |
| max_tokens: 60, | |
| top_p: 1.0, | |
| frequency_penalty: 0.5, | |
| presence_penalty: 0.0, | |
| stop: ["."], | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const completion = await openai.createCompletion({ | |
| model: "text-ada-001", | |
| prompt: one_shot_text, | |
| temperature: 0, | |
| max_tokens: 60, | |
| top_p: 1.0, | |
| frequency_penalty: 0.5, | |
| presence_penalty: 0.0, | |
| stop: ["."], | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { Configuration, OpenAIApi } = require("openai"); | |
| const configuration = new Configuration({ | |
| apiKey: process.env.OPENAI_API_KEY, | |
| }); | |
| const openai = new OpenAIApi(configuration); | |
| const response = await openai.createCompletion({ | |
| model: "code-davinci-002", | |
| prompt: "Can you print 'Hello World' in Javascript?", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM node:16 | |
| WORKDIR /usr/src/app | |
| COPY . . | |
| EXPOSE 8000 | |
| CMD [ "node", "server.js" ] |