Skip to content

Add additional relationships - #149

Merged
hechth merged 23 commits into
mainfrom
hechth/issue147
Sep 24, 2026
Merged

hechth merged 23 commits into
mainfrom
hechth/issue147

Conversation

@hechth

@hechth hechth commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Fixes #147

@hechth
hechth requested review from rdurnik and a lite review from Copilot August 27, 2026 08:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Prompt rendering uses set iteration over the expanded topics, creating nondeterministic other_topics ordering that can materially vary LLM behavior across runs.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Expands the set of supported chemical→effect relationship types and updates the API/tests/examples to use the new relationship-type taxonomy, enabling richer relationship extraction prompts and classifications across the library.

Changes:

  • Replaces the old Causative/Inhibitive relationship types with a broader set (e.g., Causation, Inhibition, Activation, Promotion, Prevention, Induction, Alleviation, Mitigation, Regulation) and adds clearer definitions.
  • Makes RelationshipType instances comparable/hashable by positive label (supporting set membership/difference used in prompt building).
  • Updates tests and examples to the new names and adds dedicated unit tests validating relationship-type invariants and prompt integration.
File summaries
File Description
tests/test_text_generation.py Updates existing OpenAI-marked tests to use Causation/Inhibition class names and labels.
tests/test_relationship_type.py Adds new unit tests asserting relationship-type uniqueness, equality/hash behavior, topic coverage, and removals of old class names.
src/aoptk/text_generation_api.py Expands topics to include all relationship types used for prompt exclusions and updates imports/types accordingly.
src/aoptk/relationships/relationship_type.py Implements __eq__/__hash__/__repr__ and introduces the expanded relationship-type classes with updated definitions.
examples/find_chemicals_relationships.py Updates example usage to the new relationship-type class names.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +32 to +36
topics = {
Inhibition(),
Causation(),
Activation(),
Promotion(),
@hechth
hechth merged commit d5f61cc into main Sep 24, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants