This file contains 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
You are an AI assistant designed to provide detailed, step-by-step responses. Your outputs should follow this structure: | |
1. Begin with a <thinking> section. Everything in this section is invisible to the user. | |
2. Inside the thinking section: | |
a. Briefly analyze the question and outline your approach. | |
b. Present a clear plan of steps to solve the problem. | |
c. Use a "Chain of Thought" reasoning process if necessary, breaking down your thought process into numbered steps. | |
3. Include a <reflection> section for each idea where you: | |
a. Review your reasoning. | |
b. Check for potential errors or oversights. |
This file contains 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
import { z } from "zod"; | |
import { zodResponseFormat } from "openai/helpers/zod"; | |
const uiSchema = z | |
.lazy(() => | |
z.object({ | |
type: z | |
.enum(["div", "button", "header", "section", "field", "form"]) | |
.describe("The type of the UI component"), | |
label: z |
This file contains 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
# Example of using SQLite VSS with OpenAI's text embedding API | |
# from Ruby. | |
# Note: Install/bundle the sqlite3, sqlite_vss, and ruby-openai gems first | |
# OPENAI_API_KEY must also be set in the environment | |
# Other embeddings can be used, but this is the easiest for a quick demo | |
# More on the topic at | |
# https://observablehq.com/@asg017/introducing-sqlite-vss | |
# https://observablehq.com/@asg017/making-sqlite-extension-gem-installable |
This file contains 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
DisconnectWSLambda: | |
Type: AWS::Serverless::Function | |
Properties: | |
Handler: index.handler | |
CodeUri: "/var/task/src/ws/disconnect" | |
Runtime: nodejs16.x | |
Architectures: | |
- x86_64 | |
MemorySize: 1152 | |
DisconnectWSRoute: |
This file contains 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
DefaultWSLambda: | |
Type: AWS::Serverless::Function | |
Properties: | |
Handler: index.handler | |
CodeUri: "/var/task/src/ws/default" | |
Runtime: nodejs16.x | |
DefaultWSRoute: | |
Type: AWS::ApiGatewayV2::Route | |
Properties: | |
ApiId: |
This file contains 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
ConnectWSLambda: | |
Type: AWS::Serverless::Function | |
Properties: | |
Handler: index.handler | |
CodeUri: "/var/task/src/ws/connect" | |
ConnectWSRoute: | |
Type: AWS::ApiGatewayV2::Route | |
Properties: | |
ApiId: | |
Ref: WS |
This file contains 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
WS: | |
Type: AWS::ApiGatewayV2::Api | |
Properties: | |
Name: MyappWebsocketStaging | |
ProtocolType: WEBSOCKET | |
RouteSelectionExpression: "$request.body.message" | |
WebsocketDeployment: | |
Type: AWS::ApiGatewayV2::Deployment | |
DependsOn: | |
- ConnectWSRoute |
This file contains 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
DataTable: | |
Type: AWS::DynamoDB::Table | |
Properties: | |
KeySchema: | |
- AttributeName: scopeID | |
KeyType: HASH | |
- AttributeName: dataID | |
KeyType: RANGE | |
AttributeDefinitions: | |
- AttributeName: scopeID |
This file contains 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
--- | |
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: Exported by architect/package@8.4.1 on 2023-03-02T00:58:20.484Z | |
Resources: | |
Role: | |
Type: AWS::IAM::Role | |
Properties: | |
AssumeRolePolicyDocument: | |
Version: '2012-10-17' |
NewerOlder