Rechercher

Article
· Juin 19 3m de lecture

Innovating for Generative Elegance

Audience

Those curious in exploring new GenerativeAI usecases.

Shares thoughts and rationale when training generative AI for pattern matching.

Challenge 1 - Simple but no simpler

A developer aspires to conceive an elegant solution to requirements.
Pattern matches ( like regular expressions ) can be solved for in many ways. Which one is the better code solution?
Can an AI postulate an elegant pattern match solution for a range of simple-to-complex data samples?

Consider the three string values:

  • "AA"
  • "BB"
  • "CC"

The expression: "2 Alphabetic characters" matches all these values and other intuitively similar values in general flexible way.

Alternatively the expression: "AA" or "BB" or "CC" would be a very specific way to match only these values:

Another way to solve would be: "A" or "B" or "C", twice over.

Challenge 2  - Incomplete sample

Pattern problems rarely have every example specified.
A performative AI needs to accept a limited incomplete sample of data rows and postulate a reasonable pattern match expression.
A Turing goal would be to meet parity with human inference for a pattern for representative but incomplete data.

Better quality of sample processing is a higher prioity than expanding the token window for larger sample sizes.

 

Challenge 3 - Leverage repeating sequences

Extending the previous example, to also include single character values

  • "A"
  • "B"
  • "C"

This seems more elegant than specifying ALL the possible values long-hand.

 if test?1(1"A",1"B",1"C",1"AA",1"BB",1"CC")

 

Challenge 4 - Delimited data bias

A common need beyond generalized patterns is to solve for delimited data. For example a random phone number format

213-5729-57986

Could be solved by expression:
3 Numeric, dash, 4 numeric, dash, 4 numeric 

 if test?3N1"-"4N1"-"4N

This can be normalized with repeat sequence to:

 if test?3N2(1"-"4)

Essentially this means having a preference for explicitly specifying a delimiter for example "-" instead of generalizing delimiters as punctuation characters. So generated output should prefer to avoid over-generalization for example:

 if test?3N1P4N1P4N

 

Challenge 5 - Repeating sequences

Consider formatted numbers with common prefix codes.

The AI model detects three common sequences across the values and biases the solution to reflect an interest in this feature:

On this occasion the AI has decided to generate a superfluous "13" string match.

Howeve, as indicated by the tool, the pattern will match all the values provided.

The pattern can easily be adjusted in the free text description and regenerated.

Inference Speed

Workbench AI assistance with qualified partial success can be an accelerator to implementation.
Above a complexity threshold an AI assistant can deduce proposals faster than manual analysis.
Consider the following AI inference attempt with qualified partial success:

The AI assistant uses as many rows of data that it can fit into its token context window for processing, skipping excess data rows.
The number of rows is quantified in the generated output showing how data was truncated for inference.
This can be useful to elevate preferred data rows back into the context window for refined reprocessing.

 

Training Effort

Targeting Nvidia Cuda A10 GPU on Huggingface.
Supervised model training.

Stage Continuous GPU training
Prototype base dataset 4 days
Main dataset 13 days
Second refined dataset 2 days

 

Conclusion

Single-shot generative inference with constrained token-size can usefully approach discrete code solution elegance in absence of chain-of-thought processing by curating subject expert bias into base training data.
AI assistants can participate in iterative solution workflows.

 

Explore more

Get hands on and explore the technology demo currently hosted via Huggingface.
The cog symbol on buttons in demo indicate where AI generation is being employed

Demo written for English, French and Spanish audience.

1 Comment
Discussion (1)2
Connectez-vous ou inscrivez-vous pour continuer
Question
· Juin 19

Stop HTTP Response content

Hi Guys,

below is a running a URL in a browser to connect and get live advertising packets data from Cassia AC server which keeps the connect live and keep going and population data. 

 

So now I'm doing the same in the below code but the issue I'm not getting anything and it gets stuck at Get(HttpURL) line because it hanging on that live connection I guess and not outputting, so how can I get the HTTP request to exit and get me only a snapshot of that data, maybe something like 20 sec worth of data?  

 BleMac="DC:0D:30:9E:3A:EC",GatewayMac="CC:1B:E0:E2:56:18"
Token=##class(SX3.Task.TemperatureCollection).GetAuth()
Set Httprequest=##class(%Net.HttpRequest).%New()
Set Httprequest.SSLConfiguration="RTLS"
Set Httprequest.Server="MyURL"
Set Httprequest.Timeout=30
Set Httprequest.Https=1
//S Httprequest.WriteTimeout=10
set Httprequest.ContentType="application/json"
Do Httprequest.SetHeader("Accept","application/json")
Do Httprequest.SetHeader("Accept-Language","en_US")
Do Httprequest.SetHeader("Authorization","Bearer "_Token)
Set HttpURL="/api/gap/nodes?filter_mac="_BleMac_"&filter_rssi=-75&mac="_GatewayMac_"&active=1&event=1&chip=1&access_token="_Token
^check("1222")=HttpURL_"|"_Token
Set tSc=Httprequest.Get(HttpURL)
^check("122")=1
^data=Httprequest.HttpResponse.Data.Read(Httprequest.HttpResponse.Data.Size)
//W !,Httprequest.HttpResponse.Data.ReadLine()
//S obj=##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject(Httprequest.HttpResponse.Data.Read(Httprequest.HttpResponse.Data.Size),,.list)

 

Thanks

1 Comment
Discussion (1)1
Connectez-vous ou inscrivez-vous pour continuer
Question
· Juin 18

Custom Description Popup Text for Interoperability Production Business Hosts

I seem to remember making this work before, but I'm not having any luck digging up examples.

I've defined some custom properties for a business operation that could definitely benefit from having popup descriptions available in the Production Configuration. I have triple-slash comments before each property that do just that in the source. I thought those provided the text for the popup descriptions when clicking on the property name, but apparently not.

Any thoughts?

10 Comments
Discussion (10)2
Connectez-vous ou inscrivez-vous pour continuer
Article
· Juin 18 2m de lecture

Options for Python Devs + Poll!

I am writing this post primarily to gather an informal consensus on how developers are using Python in conjunction with IRIS, so please respond to the poll at the end of this article! In the body of the article, I'll give some background on each choice provided, as well as the advantages for each, but feel free to skim over it and just respond to the poll.

 

As most of you are probably aware, Python is currently the most popular programming language among developers around the world - and for good reason. Python is intuitive, easy to read, has an expanse of libraries and packages, and offers a number of resources for solving almost any problem. For these reasons and more, Python is a natural first choice for developers. 

So, when a developer first starts working with InterSystems IRIS, a common question might come up: "Can I use Python while still getting the most out of IRIS?" The answer? "Yes!" This article will introduce a few of the most common ways Python can be used in conjunction with InterSystems IRIS.

Options for Using Python with IRIS:

1. Embedded Python:
Introduced in 2021, Embedded Python allows for writing and executing Python code directly within ObjectScript. This allows for side-by-side use of Python and ObjectScript, allowing developers  to integrate Python and IRIS. This is a great choice for those who want to use Python while never leaving the IRIS environment.

2. ODBC Connectivity, via pyODBC:
You can also connect external Python apps to IRIS using ODBC, just like in a traditional client-server architectures. This is probably the most widely-used integration method, since it uses familiar SQL-based workflows for Python developers. The pyODBC package supports the DB API 2.0 specification, and lets you execute SQL queries on IRIS databases.

3.InterSYstems Native API and ELS:
These two options give you more flexible integration between Python and IRIS:
    a. Native API for Python: this gives direct access to core IRIS features like persistent classes and global structures. It's best for when you want to work with IRIS-specific consturcts programmatically from Python.
    b. External Language Server: This lets IRIS to call out to Python code running in a separate process, or even on a separate server. It's super useful when the Python code is resource-intensive (high CPU oor memory usage) or when you might want isolation from the IRIS kernel for stability/scalability.

In Summary:
Python and InterSystems IRIS complement each other well. Whether you're a developer with limited ObjectScript experience, someone who's looking to take advantage of Python's ecosystem, or simply prefer writing code in Python, there are several integration paths available to you. Each option has different benefits based on your architecture and use case. 

Thank you for reading this brief overview of the ways you can use Python with InterSystems IRIS!

5 Comments
Discussion (5)4
Connectez-vous ou inscrivez-vous pour continuer
Question
· Juin 18

SSL/TLS unsupported protocol error

I'm using a %Net.HttpRequest which had been successful in the past, but started failing at some point with a SSL/TLS protocol error.

ERROR #6085: Unable to write to socket with SSL/TLS configuration 'groundca', error reported 'SSL/TLS error in SSL_connect(), SSL_ERROR_SSL: protocol error, error:14077102:SSL routines:SSL23_GET_SERVER_HELLO:unsupported protocol'

The SSL/TLS configuration:

The request's SSLConfig is set to the "groundca" config when making the request.

A request using the same URL, API key, and CA file through Curl receives the desired response from the API at "https://osrd.atlassian.net/rest/api/2/issue/<issue-name>", so I believe the issue isn't with the OS, networking, or API server. It shows that Curl is using TLSv1.3.

This thread makes me think perhaps an older version of SSL is being used in the Caché request instead of TLS even though the SSL/TLS config is set to use TLS, since the post also shows "SSL23" in the error, and suggests it comes from the OP's config being set to use 'SSL23' rather than 'tls12': https://github.com/lefcha/imapfilter/issues/140#issuecomment-259671735

Another IS thread shows a similar issue that was worked around. They believed a lack of SNI was the issue, though this was a handshake error rather than a protocol error: https://community.intersystems.com/post/how-do-not-use-sslv3-force-tls-variant-httprequest-aws-api-gateway

 

Edit - adding ^REDEBUG log output:

06/19/25-09:52:07:258 (11524) 0 tpopen for host osrd.atlassian.net device number 25334188 port 443  mode 0x8848 tcpmode 0x24 terminators  ibfsz 8192 obfsz 8192 queuesize 5 timeout 30 tcpsbuf=0 tcprbuf=0, XY=off, BINDTO=
06/19/25-09:52:07:275 (11524) 0 TCPConnect: SNDBUF sys size=65536, dev size=0
06/19/25-09:52:07:276 (11524) 0 TCPConnect: RCVBUF sys size=65536, dev size=0
06/19/25-09:52:07:281 (11524) 0 
TCP connected to site 13.227.180.4 port 443
06/19/25-09:52:07:282 (11524) 0 StreamInit: SNDBUF sys size=65536, dev size=0
06/19/25-09:52:07:283 (11524) 0 StreamInit: RCVBUF sys size=65536, dev size=0
06/19/25-09:52:07:284 (11524) 0 
SSL/TLS configuration: groundca
06/19/25-09:52:07:285 (11524) 0 
Cipher list: ALL:!aNULL:!eNULL:!EXP:!SSLv2
06/19/25-09:52:07:285 (11524) 0 
Trusted certificate file: c:\Users\dwp\downloads\cacert.pem
06/19/25-09:52:07:296 (11524) 0 

Peer verification option = 1, certificate depth = 9
06/19/25-09:52:07:297 (11524) 0 
SSL/TLS client requested.
06/19/25-09:52:07:300 (11524) 0 
SSL/TLS error return from SSL_connect().
06/19/25-09:52:07:301 (11524) 0 
SSL_ERROR_SSL: protocol error
06/19/25-09:52:07:302 (11524) 0 
error:14077102:SSL routines:SSL23_GET_SERVER_HELLO:unsupported protocol
06/19/25-09:52:07:304 (11524) 0 
TPXMIT saw TCP device fail

 

Edit 2:

We're calling out to Curl with zf(-1) and having Curl write the result to a file so it can be read in that way. I'm still wondering whether the wrong version of SSL is being used because of the other post mentioning the same error for another tool, but I doubt we'll look into it further for now.

3 Comments
Discussion (3)2
Connectez-vous ou inscrivez-vous pour continuer