Timeplus neutrino is a python library for Timeplus AI agent
Project description
neutrino
Neutrinos are nearly massless and can pass through matter effortlessly, representing smooth and efficient data onboarding.
pipeline build
install neutrino 'pip install timeplus-neutrino'
- run timeplus enterprise
- export following environment
export TIMEPLUS_HOST=localhost
export TIMEPLUS_AISERVICE_USER=user
export TIMEPLUS_AISERVICE_PASSWORD=password
export TIMEPLUS_AISERVICE_DB=aiservice
- run following python code
import os
import json
from neutrino.conf import TimeplusAgentConfig
from neutrino.pipeline.cdc import build_debezium_pipeline_sync
from neutrino.utils.tools import extract_code_blocks_with_type
agent_config = TimeplusAgentConfig()
# config open ai compatible model
#agent_config.config("default", "https://generativelanguage.googleapis.com/v1beta/openai/", os.environ["GEMINI_API_KEY"], "gemini-2.5-pro-preview-06-05")
agent_config.config("default", "https://api.openai.com/v1", os.environ["OPENAI_API_KEY"], "gpt-4o")
# config kafka
kafka_topic = "mongodb.lumi_data.unstructured_data"
kafka_config = {
"security.protocol": 'PLAINTEXT',
"bootstrap.servers":'localhost:19092'
}
# config kafka with SASL
'''
kafka_topic = "demo.cdc.mysql.retailer.orders"
kafka_config = {
"security.protocol": 'SASL_SSL',
"bootstrap.servers":'kafka.demo.timeplus.com:9092',
"sasl.mechanism": 'PLAIN',
"sasl.username": 'demo',
"sasl.password": 'demo123',
"enable.ssl.certificate.verification": 'false'
}
'''
# external stream settings
settings = {
"type" :'s3',
"access_key_id" : 'minioadmin',
"secret_access_key" : 'minioadmin',
"region" : 'us-east-1',
"bucket" : 'timeplus',
"data_format" : 'JSONEachRow',
"endpoint" : 'http://minio:9000',
"write_to" : 'lumi/data.json',
"use_environment_credentials" : False
}
result = build_debezium_pipeline_sync(kafka_topic, kafka_config, database="test", target_stream_settings=settings)
print(f"the pipeline building for topic {kafka_topic} result is: {result}")
extracted_codes =extract_code_blocks_with_type(result)
extracted_code_type, extracted_code_content = extracted_codes[0]
print(f"the extracted code type is: {extracted_code_type}")
extracted_code_content_obj = json.loads(extracted_code_content)
print(f"the extracted code content is: {json.dumps(extracted_code_content_obj, indent=2)}")
print(f"the extracted source_stream is: {extracted_code_content_obj["source_stream"]}")
print(f"the extracted target_stream is: {extracted_code_content_obj["target_stream"]}")
print(f"the extracted extraction_mv is: {extracted_code_content_obj["extraction_mv"]}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
timeplus_neutrino-0.1.15.tar.gz
(203.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file timeplus_neutrino-0.1.15.tar.gz.
File metadata
- Download URL: timeplus_neutrino-0.1.15.tar.gz
- Upload date:
- Size: 203.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55c259bdba0fc4d425ad88ca2cfb74a94646f3d37a77b4398d72e668e1c0ea2f
|
|
| MD5 |
5284ccda39384e54bbe9509e23991ca4
|
|
| BLAKE2b-256 |
9f7e767be8b4012138dc8552766178dde42fba278128d37eac38b013a8aad1e9
|
File details
Details for the file timeplus_neutrino-0.1.15-py3-none-any.whl.
File metadata
- Download URL: timeplus_neutrino-0.1.15-py3-none-any.whl
- Upload date:
- Size: 76.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6da05f3b66b7d36491c74480e4b20dfbced440e301ddf0bcbf55fcd0acdc0944
|
|
| MD5 |
d71637cea311337736d37f402dfb2c77
|
|
| BLAKE2b-256 |
bd82c1289e9bfbf3e2cff5396c349648d62df5dc4317b3c42bad5682c5612d5a
|