bob_nlp_tools

ROS 2 semantic NLP tools package.

Submodules

Classes

NlpSemanticDriver

A standalone, non-ROS driver for semantic NLP tasks via OpenAI-compatible APIs.

Package Contents

class bob_nlp_tools.NlpSemanticDriver(api_key, base_url='https://api.openai.com/v1', model='gpt-3.5-turbo', timeout=15)

A standalone, non-ROS driver for semantic NLP tasks via OpenAI-compatible APIs.

api_key
base_url = ''
model = 'gpt-3.5-turbo'
timeout = 15
logger
ask(system_prompt, user_input, temperature=0.0)

Perform base chat completion call.

route(content, targets: dict)

Perform semantic routing.

Given content and a dict of targets {key: description}, returns the best matching key.

semantic_filter(content, criterion)

Perform semantic check. Returns True if content meets the criterion.

summarize(content, context='', max_words=50)

Perform semantic summary helper.

normalize(content, instructions='Transform to valid JSON')

Normalize input based on descriptive instructions.