Coming from Python I wanted to write something like this:
@trace('name', opts)
def business_logic(foo, bar):
return 0To use opentelemetry in specific function and having goodies like putting relevant stuff in the context.
| trait Logger { | |
| protected def formatMessage(message: String): String | |
| def log(message: String): Unit = { | |
| println(formatMessage(message)) | |
| } | |
| // Nested case class inside the trait | |
| case class LogEntry(timestamp: Long, content: String) | |
| } |
Coming from Python I wanted to write something like this:
@trace('name', opts)
def business_logic(foo, bar):
return 0To use opentelemetry in specific function and having goodies like putting relevant stuff in the context.
| // | |
| // Études: Quirks and Implications of Numbers in JavaScript | |
| // | |
| // Reading: | |
| // - [Here is what you need to know about JavaScript’s Number type - Max Koretskyi](https://medium.com/angular-in-depth/javascripts-number-type-8d59199db1b6) | |
| // Quotes: | |
| // > Why 0.1+0.2 IS NOT equal to 0.3 and 9007199254740992 IS equal to 9007199254740993 | |
| // | |
| // > According to the ECMAScript standard, there is only one type for numbers and it is the ‘double-precision 64-bit | |
| // > binary format IEEE 754 value’. This type is used to store both integers and fractions and is the equivalent of `double` |
export function cache<T extends (...args: any[]) => any, KeyType, ResultType, ErrorType>(
fn: T,
options: Partial<ICacheOptions<KeyType, ResultType, ErrorType>> = {}
): T {
const mergedOptions: ICacheOptions<KeyType, ResultType, ErrorType> = {"tools": [
{
"functionDeclarations": [
{
"name": "browser_subagent",
"description": "Start a browser subagent to perform actions in the browser with the given task description. The subagent has access to tools for both interacting with web page content (clicking, typing, navigating, etc) and controlling the browser window itself (resizing, etc). Please make sure to define a clear condition to return on. After the subagent returns, you should read the DOM or capture a screenshot to see what it did. Note: All browser interactions are automatically recorded and saved as WebP videos to the artifacts directory. This is the ONLY way you can record a browser session video/animation. IMPORTANT: if the subagent returns that the open_browser_url tool failed, there is a browser issue that is out of your control. You MUST ask the user how to proceed and use the suggested_responses tool.",