Skip to content

Commit

Permalink
🚜 Reorg and move prompt commands around
Browse files Browse the repository at this point in the history
  • Loading branch information
wesen committed Feb 2, 2023
1 parent 347e6ed commit 12da7c9
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 0 deletions.
File renamed without changes.
54 changes: 54 additions & 0 deletions cmd/pinocchio/prompts/examples/code/php-property-promotion.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: php-property-promotion
short: Generate a class with constructor property promotion
factories:
openai:
client:
timeout: 120
completion:
engine: code-cushman-001
temperature: 0.2
max_response_tokens: 1024
stop:
- // End Output
# stream: true
flags:
- name: instructions
type: string
help: Additional language specific instructions
- name: readonly
type: bool
default: true
help: Make the class readonly
arguments:
- name: input_file
type: stringFromFile
help: Input file containing the attribute definitions
required: true
prompt: |
Write a {{ if .readonly }}readonly{{end}} PHP class with constructor property promotion for the following fields.
{{ if .instructions }}{{ .instructions }}{{ end }}
For example:
// Input
public ?int $productId; // Internal product ID for reference
public ?string $itemId; // The ID of the item
// End Input
// Output
public function __construct(
/** Internal product ID for reference */
public ?int $productId = null,
/** The ID of the item */
public ?string $itemId = null,
) {}
// End Output
Now create a constructor for the following fields.
// Input
{{ .input_file }}
// End Input
// Output
30 changes: 30 additions & 0 deletions cmd/pinocchio/prompts/examples/simple/chain_of_thought.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: chain-of-thought
short: Show a chain of thought example
factories:
openai:
client:
timeout: 120
completion:
engine: text-curie-001
temperature: 0.2
max_response_tokens: 256
# stream: true
flags:
- name: with_chain_of_thought
type: bool
help: Enable chain of thought
prompt: |
Given: The database tables orders(customer_id,shipping_state,value), line_items(order_id,product_id,quantity), products(id,category) and the categories shrubs, roses, azaleas, privacy trees, maple trees.
Question: How many people ordered flowers in the southwest since spring?
SQL:
SELECT COUNT(DISTINCT orders.customer_id)
FROM orders
JOIN line_items ON orders.order_id = line_items.order_id
JOIN products ON line_items.product_id = products.id
WHERE products.category IN ('roses', 'azaleas')
AND orders.shipping_state IN ('AZ', 'NM', 'TX', 'CO', 'UT', 'NV', 'OK')
AND orders.value >= '2022-03-20'
Question: What is the average order value of orders containing trees placed last year in the north east?
SQL:
File renamed without changes.

0 comments on commit 12da7c9

Please sign in to comment.