├── .DS_Store ├── .gitignore ├── .npmignore ├── .reason.config.js ├── README.md ├── ast-transforms ├── actions │ ├── action-observervability.js │ ├── action-prompt-info.js │ ├── actionError.js │ ├── actionObserver.ts │ └── actions.js ├── agents │ ├── agent-observability.js │ ├── agent-prompt-info.js │ ├── agent-transform.js │ ├── agentError.js │ └── agentObserver.ts ├── getBasePath.js ├── internalname.js ├── isPathFromReason.js ├── think │ ├── think-prompt-info.js │ ├── think-stream-prompt-info.js │ ├── think-transform.js │ └── thinkError.js └── utils │ ├── get-imports.js │ ├── get-ts-types.js │ ├── isJs.js │ ├── jsdoc-parser.js │ ├── to-json-schema.js │ └── to-ts-ast.js ├── bun.lockb ├── commands ├── reason-command.js └── tryreason-command.js ├── compiler └── ts-dev-mode-loader.mjs ├── configs ├── anyscale.ts ├── openai.ts └── reason-config.ts ├── functions ├── __internal │ ├── StremableObject.ts │ ├── __internal_agent.ts │ ├── __internal_think.ts │ └── think-extractor.ts ├── agent.ts ├── index.ts ├── stream.ts └── think.ts ├── observability ├── context.d.ts ├── createContext.ts ├── setup-opentel.ts └── tracer.ts ├── package-lock.json ├── package.json ├── scripts └── post-install.js ├── server ├── StreamEncoder.ts ├── entrypoints.ts ├── error-handler.ts ├── fetch-standard.ts ├── handlers │ ├── asyncFunctionHandler.ts │ ├── asyncGeneratorHandler.ts │ ├── entrypointHandler.ts │ └── functionHandler.ts ├── index.ts ├── server.ts ├── serverError.ts └── setup.ts ├── services ├── anyscale │ ├── getChatCompletion.ts │ └── getFunctionCompletion.ts ├── db.ts ├── getChatCompletion.ts ├── getFunctionCompletion.ts └── openai │ ├── getChatCompletion.ts │ └── getFunctionCompletion.ts ├── sqlite ├── .DS_Store ├── sqlite-dialect-config.ts ├── sqlite-dialect.ts └── sqlite-driver.ts ├── tests ├── ast-transforms │ └── utils │ │ └── to-json-schema.spec.ts ├── server │ ├── StreamEncoder.spec.ts │ └── entrypoints.spec.ts └── utils │ └── complete-json.spec.ts ├── tsconfig.json ├── tsconfig.tsbuildinfo ├── types ├── actionConfig.d.ts ├── agentConfig.d.ts ├── db │ ├── agent-history.d.ts │ └── database.d.ts ├── iagent.d.ts ├── oai-chat-models.d.ts ├── reasonConfig.d.ts ├── server.d.ts ├── streamable.d.ts └── thinkConfig.d.ts ├── utils ├── asyncLocalStorage.ts ├── complete-json.ts ├── isDebug.js ├── isDebug.ts ├── libname.js ├── oai-function.ts └── reasonError.js └── web ├── .gitignore ├── README.md ├── a.ts ├── app ├── entrypoint │ └── [entrypoint] │ │ └── page.tsx ├── favicon.ico ├── globals.css ├── layout.tsx └── page.tsx ├── bun.lockb ├── components.json ├── components ├── GradientHeading.tsx ├── ReasonNotFound.tsx ├── ReasonTitle │ ├── dynamic.tsx │ ├── index.tsx │ └── static.tsx ├── entrypoint │ ├── ResponseVisualizer.tsx │ ├── chat │ │ └── ActionVisualizer.tsx │ └── request-information │ │ ├── Body.tsx │ │ ├── Header.tsx │ │ └── RequestInfo.tsx └── ui │ ├── accordion.tsx │ ├── button.tsx │ ├── card.tsx │ ├── input.tsx │ ├── label.tsx │ ├── popover.tsx │ ├── switch.tsx │ ├── tabs.tsx │ ├── textarea.tsx │ ├── toast.tsx │ ├── toaster.tsx │ ├── tooltip.tsx │ └── use-toast.ts ├── gradients.ts ├── hooks ├── useChat.tsx └── useReason.tsx ├── lib └── utils.ts ├── next.config.js ├── package copy.json ├── package-lock.json ├── package.json ├── postcss.config.js ├── public └── bg4.jpg ├── reason ├── ReasonError.ts └── StreamDecoder.ts ├── tailwind.config.js ├── tailwind.config.ts └── tsconfig.json /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/try-reason/reason/113046a45d8cceea6ac6cfe87af77565fdabf06a/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | package 4 | **.tgz 5 | web/.next -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | **.tgz 2 | node_modules 3 | 4 | web/node_modules 5 | web/app 6 | web/components 7 | web/hooks 8 | web/lib 9 | web/reason 10 | web/components.json 11 | web/README.md 12 | web/tailwind.config.js 13 | web/tailwind.config.ts 14 | web/postcss.config.js 15 | web/tsconfig.json 16 | 17 | /* 18 | 19 | !/dist 20 | !/scripts 21 | !/web 22 | !/sample 23 | !/sample/.reason.config.js 24 | !/package.json -------------------------------------------------------------------------------- /.reason.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/try-reason/reason/113046a45d8cceea6ac6cfe87af77565fdabf06a/.reason.config.js -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### ⚠️ RΞASON is now deprecated and probably not working due to changes in the OpenAI API. 2 | 3 |  4 | 5 |
7 | The minimalistic Typescript framework for building great LLM apps. 8 |
9 | 10 | ```bash 11 | npx use-reason@latest 12 | ``` 13 | A small demo: 14 | ```ts 15 | import { reason } from 'tryreason' 16 | 17 | interface Joke { 18 | /** Use this property to indicate the age rating of the joke */ 19 | rating: number; 20 | joke: string; 21 | 22 | /** Use this property to explain the joke to those who did not understood it */ 23 | explanation: string; 24 | } 25 | 26 | const joke = await reason{JSON.stringify(action.input, null, 2)}35 | 36 |
{JSON.stringify(action.output, null, 2)}38 |