fix(mental-models): add tags_match and tag_groups to trigger config (#786) (#804)

When a mental model has tags, refresh_mental_model hardcoded
tags_match="all_strict", causing empty results when most memories
are untagged. Add configurable tags_match and tag_groups fields
to MentalModelTrigger so users can control refresh filtering.

- Add tags_match (any/all/any_strict/all_strict) to override default
- Add tag_groups for compound boolean tag expressions during refresh
- Default behavior unchanged (all_strict when tags present)
- Update both refresh paths (task-based and direct)
- Add UI controls in Create/Update mental model dialogs
- Regenerate OpenAPI spec and client SDKs
This commit is contained in:
Nicolò Boschi 2026-03-31 18:09:01 +02:00 committed by GitHub
parent baf5447de2
commit 2c32ffadc9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 3747 additions and 549 deletions

View file

@ -1502,6 +1502,23 @@ class MentalModelTrigger(BaseModel):
default=None,
description="Exclude specific mental models by ID from the reflect loop.",
)
tags_match: TagsMatch | None = Field(
default=None,
description=(
"Override how the model's tags filter memories during refresh. "
"If not set, defaults to 'all_strict' when the model has tags (security isolation) "
"or 'any' when the model has no tags. "
"Set to 'any' to include untagged memories alongside tagged ones during refresh."
),
)
tag_groups: list[TagGroup] | None = Field(
default=None,
description=(
"Compound boolean tag expressions to use during refresh instead of the model's own tags. "
"When set, these tag groups are passed to reflect and the model's flat tags are NOT used for filtering. "
"Supports nested and/or/not expressions for complex tag-based scoping."
),
)
@field_validator("fact_types")
@classmethod

View file

@ -16,6 +16,7 @@ import logging
import time
import uuid
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from datetime import UTC, datetime, timedelta, timezone
from typing import TYPE_CHECKING, Any
@ -226,6 +227,42 @@ def _get_tiktoken_encoding():
return _TIKTOKEN_ENCODING
@dataclass(frozen=True)
class RefreshTagFiltering:
"""Resolved tag filtering parameters for mental model refresh."""
tags: list[str] | None
tags_match: TagsMatch
tag_groups: list[TagGroup] | None
def _resolve_refresh_tag_filtering(
model_tags: list[str] | None,
trigger_data: dict[str, Any],
) -> RefreshTagFiltering:
"""Resolve tag filtering parameters for mental model refresh.
Takes raw trigger dict from DB (JSONB with no fixed schema guarantee)
and resolves the tag filtering to use during reflect.
Priority:
- If trigger has tag_groups, use those (overrides flat tags entirely)
- If trigger has tags_match, use model's tags with that match mode
- Otherwise default to all_strict when tags present (security isolation)
"""
trigger_tag_groups = trigger_data.get("tag_groups")
if trigger_tag_groups is not None:
from pydantic import TypeAdapter
adapter = TypeAdapter(TagGroup)
parsed = [adapter.validate_python(tg) for tg in trigger_tag_groups]
return RefreshTagFiltering(tags=None, tags_match="any", tag_groups=parsed)
trigger_tags_match = trigger_data.get("tags_match")
tags_match: TagsMatch = trigger_tags_match if trigger_tags_match else ("all_strict" if model_tags else "any")
return RefreshTagFiltering(tags=model_tags, tags_match=tags_match, tag_groups=None)
class MemoryEngine(MemoryEngineInterface):
"""
Advanced memory system using temporal and semantic linking with PostgreSQL.
@ -908,26 +945,23 @@ class MemoryEngine(MemoryEngineInterface):
source_query = mental_model["source_query"]
# SECURITY: If the mental model has tags, pass them to reflect with "all_strict" matching
# to ensure it can only access other mental models/memories with the SAME tags.
# This prevents cross-tenant/cross-user information leakage by excluding untagged content.
tags = mental_model.get("tags")
tags_match = "all_strict" if tags else "any"
# Read reflect options from trigger (if stored)
trigger_data = mental_model.get("trigger") or {}
fact_types = trigger_data.get("fact_types")
exclude_mental_models = trigger_data.get("exclude_mental_models", False)
stored_exclude_ids: list[str] = trigger_data.get("exclude_mental_model_ids") or []
tag_filtering = _resolve_refresh_tag_filtering(mental_model.get("tags"), trigger_data)
# Run reflect to generate new content, excluding the mental model being refreshed
# Always add self to excluded IDs to prevent circular reference
reflect_result = await self.reflect_async(
bank_id=bank_id,
query=source_query,
request_context=internal_context,
tags=tags,
tags_match=tags_match,
tags=tag_filtering.tags,
tags_match=tag_filtering.tags_match,
tag_groups=tag_filtering.tag_groups,
fact_types=fact_types,
exclude_mental_models=exclude_mental_models,
exclude_mental_model_ids=list({*stored_exclude_ids, mental_model_id}),
@ -6581,26 +6615,23 @@ class MemoryEngine(MemoryEngineInterface):
# Create parent span for mental model refresh operation
with create_operation_span("mental_model_refresh", bank_id):
# SECURITY: If the mental model has tags, pass them to reflect with "all_strict" matching
# to ensure it can only access other mental models/memories with the SAME tags.
# This prevents cross-tenant/cross-user information leakage by excluding untagged content.
tags = mental_model.get("tags")
tags_match = "all_strict" if tags else "any"
# Read reflect options from trigger (if stored)
trigger_data = mental_model.get("trigger") or {}
fact_types = trigger_data.get("fact_types")
exclude_mental_models = trigger_data.get("exclude_mental_models", False)
stored_exclude_ids: list[str] = trigger_data.get("exclude_mental_model_ids") or []
tag_filtering = _resolve_refresh_tag_filtering(mental_model.get("tags"), trigger_data)
# Run reflect with the source query, excluding the mental model being refreshed
# Skip creating a nested "hindsight.reflect" span since we already have "hindsight.mental_model_refresh"
reflect_result = await self.reflect_async(
bank_id=bank_id,
query=mental_model["source_query"],
request_context=request_context,
tags=tags,
tags_match=tags_match,
tags=tag_filtering.tags,
tags_match=tag_filtering.tags_match,
tag_groups=tag_filtering.tag_groups,
fact_types=fact_types,
exclude_mental_models=exclude_mental_models,
exclude_mental_model_ids=list({*stored_exclude_ids, mental_model_id}),

View file

@ -1022,3 +1022,310 @@ class TestMentalModelRefreshTagSecurity:
# Cleanup
await memory.delete_bank(bank_id, request_context=request_context)
class TestMentalModelTriggerTagsConfig:
"""Test trigger-level tags_match and tag_groups configuration for mental model refresh."""
async def test_trigger_tags_match_any_includes_untagged_content(
self, memory: MemoryEngine, request_context
):
"""Test that setting trigger.tags_match='any' allows a tagged model to see untagged memories.
This is the fix for #786: by default, tagged models use all_strict which excludes
untagged content. Setting tags_match='any' in the trigger overrides this.
"""
bank_id = f"test-trigger-tags-match-{uuid.uuid4().hex[:8]}"
await memory.get_bank_profile(bank_id, request_context=request_context)
# Add memories: some tagged, some untagged
await memory.retain_batch_async(
bank_id=bank_id,
contents=[
{"content": "Alice is a frontend engineer who specializes in React and TypeScript.", "tags": ["living"]},
{"content": "The company headquarters is located in San Francisco, California.", "tags": []},
{"content": "Annual revenue reached 50 million dollars last year.", "tags": []},
],
request_context=request_context,
)
await memory.wait_for_background_tasks()
# Create a mental model with tags but trigger.tags_match='any' to include untagged content
mm = await memory.create_mental_model(
bank_id=bank_id,
name="Living Summary",
source_query="What do we know about the company and people?",
content="Initial content",
tags=["living"],
trigger={"tags_match": "any"},
request_context=request_context,
)
# Refresh — should see BOTH tagged and untagged content
refreshed = await memory.refresh_mental_model(
bank_id=bank_id,
mental_model_id=mm["id"],
request_context=request_context,
)
refreshed_content = refreshed["content"].lower()
# Should include tagged content
assert "alice" in refreshed_content or "react" in refreshed_content or "frontend" in refreshed_content, (
f"Refreshed model should include tagged memories. Content: {refreshed['content']}"
)
# Should ALSO include untagged content (the fix for #786)
assert "san francisco" in refreshed_content or "50 million" in refreshed_content or "headquarters" in refreshed_content or "revenue" in refreshed_content, (
f"With tags_match='any', refreshed model should include untagged memories. Content: {refreshed['content']}"
)
await memory.delete_bank(bank_id, request_context=request_context)
async def test_trigger_tags_match_default_preserves_strict_isolation(
self, memory: MemoryEngine, request_context
):
"""Test that without trigger.tags_match, tagged models still use all_strict (backward compat)."""
bank_id = f"test-trigger-default-strict-{uuid.uuid4().hex[:8]}"
await memory.get_bank_profile(bank_id, request_context=request_context)
# Add tagged and untagged memories
await memory.retain_batch_async(
bank_id=bank_id,
contents=[
{"content": "Alice is a frontend engineer specializing in React.", "tags": ["user:alice"]},
{"content": "Bob is a backend engineer specializing in Python.", "tags": ["user:bob"]},
{"content": "The company has 200 employees worldwide.", "tags": []},
],
request_context=request_context,
)
await memory.wait_for_background_tasks()
# Create a tagged mental model WITHOUT trigger.tags_match (should default to all_strict)
mm = await memory.create_mental_model(
bank_id=bank_id,
name="Alice's Summary",
source_query="What are all the facts about work and people?",
content="Initial content",
tags=["user:alice"],
request_context=request_context,
)
refreshed = await memory.refresh_mental_model(
bank_id=bank_id,
mental_model_id=mm["id"],
request_context=request_context,
)
refreshed_content = refreshed["content"].lower()
import re
def contains_word(text: str, word: str) -> bool:
return bool(re.search(rf"\b{re.escape(word)}\b", text, re.IGNORECASE))
# MUST NOT include Bob's content (security boundary preserved)
assert not contains_word(refreshed_content, "bob") and not contains_word(refreshed_content, "python"), (
f"Default behavior should still enforce all_strict isolation. Content: {refreshed['content']}"
)
# MUST NOT include untagged content (strict excludes untagged)
assert "200 employees" not in refreshed_content, (
f"Default behavior should exclude untagged content. Content: {refreshed['content']}"
)
await memory.delete_bank(bank_id, request_context=request_context)
async def test_trigger_tag_groups_override_flat_tags(
self, memory: MemoryEngine, request_context
):
"""Test that trigger.tag_groups overrides the model's flat tags for refresh filtering.
When tag_groups is set, the model's own tags are NOT used for filtering during refresh,
giving the user full control over the search scope.
"""
bank_id = f"test-trigger-tag-groups-{uuid.uuid4().hex[:8]}"
await memory.get_bank_profile(bank_id, request_context=request_context)
# Add memories with different tags
await memory.retain_batch_async(
bank_id=bank_id,
contents=[
{"content": "Alice is a frontend engineer who works on the React dashboard.", "tags": ["user:alice"]},
{"content": "Bob is a backend engineer who maintains the Python API.", "tags": ["user:bob"]},
{"content": "The shared codebase uses TypeScript for all frontend code.", "tags": ["shared"]},
],
request_context=request_context,
)
await memory.wait_for_background_tasks()
# Create a mental model tagged user:alice, but with tag_groups that include both alice AND shared
mm = await memory.create_mental_model(
bank_id=bank_id,
name="Alice's Full View",
source_query="What do we know about people and technology?",
content="Initial content",
tags=["user:alice"],
trigger={
"tag_groups": [
{
"or": [
{"tags": ["user:alice"], "match": "all_strict"},
{"tags": ["shared"], "match": "all_strict"},
]
}
]
},
request_context=request_context,
)
refreshed = await memory.refresh_mental_model(
bank_id=bank_id,
mental_model_id=mm["id"],
request_context=request_context,
)
refreshed_content = refreshed["content"].lower()
# Should include alice's content
assert "alice" in refreshed_content or "react" in refreshed_content or "dashboard" in refreshed_content, (
f"Should include user:alice memories via tag_groups. Content: {refreshed['content']}"
)
# Should include shared content (via tag_groups OR expression)
assert "typescript" in refreshed_content or "shared" in refreshed_content or "frontend code" in refreshed_content, (
f"Should include shared memories via tag_groups. Content: {refreshed['content']}"
)
import re
def contains_word(text: str, word: str) -> bool:
return bool(re.search(rf"\b{re.escape(word)}\b", text, re.IGNORECASE))
# MUST NOT include Bob's content (not in tag_groups)
assert not contains_word(refreshed_content, "bob"), (
f"Should NOT include user:bob memories (not in tag_groups). Content: {refreshed['content']}"
)
await memory.delete_bank(bank_id, request_context=request_context)
async def test_trigger_tags_match_with_no_model_tags(
self, memory: MemoryEngine, request_context
):
"""Test that trigger.tags_match on an untagged model still works correctly."""
bank_id = f"test-trigger-untagged-{uuid.uuid4().hex[:8]}"
await memory.get_bank_profile(bank_id, request_context=request_context)
await memory.retain_batch_async(
bank_id=bank_id,
contents=[
{"content": "Alice works on React and TypeScript daily.", "tags": ["team"]},
{"content": "The office is in downtown Seattle near Pike Place.", "tags": []},
],
request_context=request_context,
)
await memory.wait_for_background_tasks()
# Untagged model with no trigger.tags_match — defaults to "any" (no tags to trigger strict)
mm = await memory.create_mental_model(
bank_id=bank_id,
name="General Summary",
source_query="What do we know about the team and office?",
content="Initial content",
request_context=request_context,
)
refreshed = await memory.refresh_mental_model(
bank_id=bank_id,
mental_model_id=mm["id"],
request_context=request_context,
)
refreshed_content = refreshed["content"].lower()
# Should include both tagged and untagged content (default "any" for untagged models)
has_tagged = "alice" in refreshed_content or "react" in refreshed_content
has_untagged = "seattle" in refreshed_content or "pike place" in refreshed_content or "downtown" in refreshed_content
assert has_tagged or has_untagged, (
f"Untagged model should see all content with default 'any' matching. Content: {refreshed['content']}"
)
await memory.delete_bank(bank_id, request_context=request_context)
class TestMentalModelTriggerSchema:
"""Unit tests for MentalModelTrigger schema validation (no DB needed)."""
def test_trigger_accepts_tags_match(self):
from hindsight_api.api.http import MentalModelTrigger
t = MentalModelTrigger(tags_match="any")
assert t.tags_match == "any"
def test_trigger_accepts_all_tags_match_modes(self):
from hindsight_api.api.http import MentalModelTrigger
for mode in ("any", "all", "any_strict", "all_strict"):
t = MentalModelTrigger(tags_match=mode)
assert t.tags_match == mode
def test_trigger_tags_match_defaults_to_none(self):
from hindsight_api.api.http import MentalModelTrigger
t = MentalModelTrigger()
assert t.tags_match is None
def test_trigger_accepts_tag_groups_leaf(self):
from hindsight_api.api.http import MentalModelTrigger
t = MentalModelTrigger(tag_groups=[{"tags": ["user:alice"], "match": "all_strict"}])
assert len(t.tag_groups) == 1
assert t.tag_groups[0].tags == ["user:alice"]
def test_trigger_accepts_tag_groups_compound(self):
from hindsight_api.api.http import MentalModelTrigger
t = MentalModelTrigger(
tag_groups=[
{
"or": [
{"tags": ["user:alice"], "match": "all_strict"},
{"tags": ["shared"], "match": "any_strict"},
]
}
]
)
assert len(t.tag_groups) == 1
from hindsight_api.engine.search.tags import TagGroupOr
assert isinstance(t.tag_groups[0], TagGroupOr)
assert len(t.tag_groups[0].filters) == 2
def test_trigger_tag_groups_defaults_to_none(self):
from hindsight_api.api.http import MentalModelTrigger
t = MentalModelTrigger()
assert t.tag_groups is None
def test_trigger_roundtrip_via_model_dump(self):
"""Test that tag_groups survive model_dump -> model_validate (simulates DB storage)."""
from hindsight_api.api.http import MentalModelTrigger
t = MentalModelTrigger(
tags_match="any",
tag_groups=[{"tags": ["a", "b"], "match": "all_strict"}],
fact_types=["world"],
)
d = t.model_dump()
t2 = MentalModelTrigger.model_validate(d)
assert t2.tags_match == "any"
assert len(t2.tag_groups) == 1
assert t2.tag_groups[0].tags == ["a", "b"]
assert t2.fact_types == ["world"]
def test_trigger_tag_groups_rejects_invalid(self):
from hindsight_api.api.http import MentalModelTrigger
from pydantic import ValidationError
with pytest.raises(ValidationError):
MentalModelTrigger(tag_groups=[{"invalid_key": "bad"}])

View file

@ -3681,7 +3681,7 @@ components:
title: Max Tokens
type: integer
trigger:
$ref: '#/components/schemas/MentalModelTrigger'
$ref: '#/components/schemas/MentalModelTrigger-Input'
required:
- name
- source_query
@ -4426,12 +4426,22 @@ components:
id: id
trigger:
refresh_after_consolidation: false
tag_groups:
- match: any_strict
tags:
- tags
- tags
- match: any_strict
tags:
- tags
- tags
fact_types:
- world
- world
exclude_mental_model_ids:
- exclude_mental_model_ids
- exclude_mental_model_ids
tags_match: any
exclude_mental_models: false
last_refreshed_at: last_refreshed_at
content: content
@ -4448,12 +4458,22 @@ components:
id: id
trigger:
refresh_after_consolidation: false
tag_groups:
- match: any_strict
tags:
- tags
- tags
- match: any_strict
tags:
- tags
- tags
fact_types:
- world
- world
exclude_mental_model_ids:
- exclude_mental_model_ids
- exclude_mental_model_ids
tags_match: any
exclude_mental_models: false
last_refreshed_at: last_refreshed_at
content: content
@ -4481,12 +4501,22 @@ components:
id: id
trigger:
refresh_after_consolidation: false
tag_groups:
- match: any_strict
tags:
- tags
- tags
- match: any_strict
tags:
- tags
- tags
fact_types:
- world
- world
exclude_mental_model_ids:
- exclude_mental_model_ids
- exclude_mental_model_ids
tags_match: any
exclude_mental_models: false
last_refreshed_at: last_refreshed_at
content: content
@ -4521,7 +4551,7 @@ components:
title: Max Tokens
type: integer
trigger:
$ref: '#/components/schemas/MentalModelTrigger'
$ref: '#/components/schemas/MentalModelTrigger-Output'
last_refreshed_at:
nullable: true
type: string
@ -4538,16 +4568,69 @@ components:
- name
- source_query
title: MentalModelResponse
MentalModelTrigger:
MentalModelTrigger-Input:
description: Trigger settings for a mental model.
properties:
refresh_after_consolidation:
default: false
description: "If true, refresh this mental model after observations consolidation\
\ (real-time mode)"
title: Refresh After Consolidation
type: boolean
fact_types:
items:
enum:
- world
- experience
- observation
type: string
nullable: true
type: array
exclude_mental_models:
default: false
description: "If true, exclude all mental models from the reflect loop (skip\
\ search_mental_models tool)."
title: Exclude Mental Models
type: boolean
exclude_mental_model_ids:
items:
type: string
nullable: true
type: array
tags_match:
enum:
- any
- all
- any_strict
- all_strict
nullable: true
type: string
tag_groups:
items:
$ref: '#/components/schemas/MentalModelTrigger_Input_tag_groups_inner'
nullable: true
type: array
title: MentalModelTrigger
MentalModelTrigger-Output:
description: Trigger settings for a mental model.
example:
refresh_after_consolidation: false
tag_groups:
- match: any_strict
tags:
- tags
- tags
- match: any_strict
tags:
- tags
- tags
fact_types:
- world
- world
exclude_mental_model_ids:
- exclude_mental_model_ids
- exclude_mental_model_ids
tags_match: any
exclude_mental_models: false
properties:
refresh_after_consolidation:
@ -4576,6 +4659,19 @@ components:
type: string
nullable: true
type: array
tags_match:
enum:
- any
- all
- any_strict
- all_strict
nullable: true
type: string
tag_groups:
items:
$ref: '#/components/schemas/MentalModelTrigger_Output_tag_groups_inner'
nullable: true
type: array
title: MentalModelTrigger
OperationResponse:
description: Response model for a single async operation.
@ -4759,7 +4855,7 @@ components:
type: string
tag_groups:
items:
$ref: '#/components/schemas/RecallRequest_tag_groups_inner'
$ref: '#/components/schemas/MentalModelTrigger_Input_tag_groups_inner'
nullable: true
type: array
required:
@ -5081,7 +5177,7 @@ components:
type: string
tag_groups:
items:
$ref: '#/components/schemas/RecallRequest_tag_groups_inner'
$ref: '#/components/schemas/MentalModelTrigger_Input_tag_groups_inner'
nullable: true
type: array
fact_types:
@ -5318,18 +5414,33 @@ components:
title: Max Tokens Per Observation
type: integer
title: SourceFactsIncludeOptions
TagGroupAnd:
TagGroupAnd-Input:
description: "Compound AND group: all child filters must match."
properties:
and:
items:
$ref: '#/components/schemas/RecallRequest_tag_groups_inner'
$ref: '#/components/schemas/MentalModelTrigger_Input_tag_groups_inner'
type: array
required:
- and
title: TagGroupAnd
TagGroupAnd-Output:
description: "Compound AND group: all child filters must match."
properties:
and:
items:
$ref: '#/components/schemas/MentalModelTrigger_Output_tag_groups_inner'
type: array
required:
- and
title: TagGroupAnd
TagGroupLeaf:
description: "A leaf tag filter: matches memories by tag list and match mode."
example:
match: any_strict
tags:
- tags
- tags
properties:
tags:
items:
@ -5347,7 +5458,7 @@ components:
required:
- tags
title: TagGroupLeaf
TagGroupNot:
TagGroupNot-Input:
description: "Compound NOT group: child filter must NOT match."
properties:
not:
@ -5355,12 +5466,30 @@ components:
required:
- not
title: TagGroupNot
TagGroupOr:
TagGroupNot-Output:
description: "Compound NOT group: child filter must NOT match."
properties:
not:
$ref: '#/components/schemas/Not_1'
required:
- not
title: TagGroupNot
TagGroupOr-Input:
description: "Compound OR group: at least one child filter must match."
properties:
or:
items:
$ref: '#/components/schemas/RecallRequest_tag_groups_inner'
$ref: '#/components/schemas/MentalModelTrigger_Input_tag_groups_inner'
type: array
required:
- or
title: TagGroupOr
TagGroupOr-Output:
description: "Compound OR group: at least one child filter must match."
properties:
or:
items:
$ref: '#/components/schemas/MentalModelTrigger_Output_tag_groups_inner'
type: array
required:
- or
@ -5511,7 +5640,7 @@ components:
nullable: true
type: array
trigger:
$ref: '#/components/schemas/MentalModelTrigger'
$ref: '#/components/schemas/MentalModelTrigger-Input'
title: UpdateMentalModelRequest
UpdateWebhookRequest:
description: Request model for updating a webhook. Only provided fields are
@ -5870,18 +5999,31 @@ components:
\ which combinations to use."
nullable: true
title: ObservationScopes
RecallRequest_tag_groups_inner:
MentalModelTrigger_Input_tag_groups_inner:
anyOf:
- $ref: '#/components/schemas/TagGroupLeaf'
- $ref: '#/components/schemas/TagGroupAnd'
- $ref: '#/components/schemas/TagGroupOr'
- $ref: '#/components/schemas/TagGroupNot'
- $ref: '#/components/schemas/TagGroupAnd-Input'
- $ref: '#/components/schemas/TagGroupOr-Input'
- $ref: '#/components/schemas/TagGroupNot-Input'
MentalModelTrigger_Output_tag_groups_inner:
anyOf:
- $ref: '#/components/schemas/TagGroupLeaf'
- $ref: '#/components/schemas/TagGroupAnd-Output'
- $ref: '#/components/schemas/TagGroupOr-Output'
- $ref: '#/components/schemas/TagGroupNot-Output'
Not:
anyOf:
- $ref: '#/components/schemas/TagGroupLeaf'
- $ref: '#/components/schemas/TagGroupAnd'
- $ref: '#/components/schemas/TagGroupOr'
- $ref: '#/components/schemas/TagGroupNot'
- $ref: '#/components/schemas/TagGroupAnd-Input'
- $ref: '#/components/schemas/TagGroupOr-Input'
- $ref: '#/components/schemas/TagGroupNot-Input'
title: Not
Not_1:
anyOf:
- $ref: '#/components/schemas/TagGroupLeaf'
- $ref: '#/components/schemas/TagGroupAnd-Output'
- $ref: '#/components/schemas/TagGroupOr-Output'
- $ref: '#/components/schemas/TagGroupNot-Output'
title: Not
ValidationError_loc_inner:
anyOf:

View file

@ -31,7 +31,7 @@ type CreateMentalModelRequest struct {
// Maximum tokens for generated content
MaxTokens *int32 `json:"max_tokens,omitempty"`
// Trigger settings
Trigger *MentalModelTrigger `json:"trigger,omitempty"`
Trigger *MentalModelTriggerInput `json:"trigger,omitempty"`
}
type _CreateMentalModelRequest CreateMentalModelRequest
@ -214,9 +214,9 @@ func (o *CreateMentalModelRequest) SetMaxTokens(v int32) {
}
// GetTrigger returns the Trigger field value if set, zero value otherwise.
func (o *CreateMentalModelRequest) GetTrigger() MentalModelTrigger {
func (o *CreateMentalModelRequest) GetTrigger() MentalModelTriggerInput {
if o == nil || IsNil(o.Trigger) {
var ret MentalModelTrigger
var ret MentalModelTriggerInput
return ret
}
return *o.Trigger
@ -224,7 +224,7 @@ func (o *CreateMentalModelRequest) GetTrigger() MentalModelTrigger {
// GetTriggerOk returns a tuple with the Trigger field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateMentalModelRequest) GetTriggerOk() (*MentalModelTrigger, bool) {
func (o *CreateMentalModelRequest) GetTriggerOk() (*MentalModelTriggerInput, bool) {
if o == nil || IsNil(o.Trigger) {
return nil, false
}
@ -240,8 +240,8 @@ func (o *CreateMentalModelRequest) HasTrigger() bool {
return false
}
// SetTrigger gets a reference to the given MentalModelTrigger and assigns it to the Trigger field.
func (o *CreateMentalModelRequest) SetTrigger(v MentalModelTrigger) {
// SetTrigger gets a reference to the given MentalModelTriggerInput and assigns it to the Trigger field.
func (o *CreateMentalModelRequest) SetTrigger(v MentalModelTriggerInput) {
o.Trigger = &v
}

View file

@ -29,7 +29,7 @@ type MentalModelResponse struct {
Content string `json:"content"`
Tags []string `json:"tags,omitempty"`
MaxTokens *int32 `json:"max_tokens,omitempty"`
Trigger *MentalModelTrigger `json:"trigger,omitempty"`
Trigger *MentalModelTriggerOutput `json:"trigger,omitempty"`
LastRefreshedAt NullableString `json:"last_refreshed_at,omitempty"`
CreatedAt NullableString `json:"created_at,omitempty"`
ReflectResponse map[string]interface{} `json:"reflect_response,omitempty"`
@ -248,9 +248,9 @@ func (o *MentalModelResponse) SetMaxTokens(v int32) {
}
// GetTrigger returns the Trigger field value if set, zero value otherwise.
func (o *MentalModelResponse) GetTrigger() MentalModelTrigger {
func (o *MentalModelResponse) GetTrigger() MentalModelTriggerOutput {
if o == nil || IsNil(o.Trigger) {
var ret MentalModelTrigger
var ret MentalModelTriggerOutput
return ret
}
return *o.Trigger
@ -258,7 +258,7 @@ func (o *MentalModelResponse) GetTrigger() MentalModelTrigger {
// GetTriggerOk returns a tuple with the Trigger field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MentalModelResponse) GetTriggerOk() (*MentalModelTrigger, bool) {
func (o *MentalModelResponse) GetTriggerOk() (*MentalModelTriggerOutput, bool) {
if o == nil || IsNil(o.Trigger) {
return nil, false
}
@ -274,8 +274,8 @@ func (o *MentalModelResponse) HasTrigger() bool {
return false
}
// SetTrigger gets a reference to the given MentalModelTrigger and assigns it to the Trigger field.
func (o *MentalModelResponse) SetTrigger(v MentalModelTrigger) {
// SetTrigger gets a reference to the given MentalModelTriggerOutput and assigns it to the Trigger field.
func (o *MentalModelResponse) SetTrigger(v MentalModelTriggerOutput) {
o.Trigger = &v
}

View file

@ -14,25 +14,27 @@ import (
"encoding/json"
)
// checks if the MentalModelTrigger type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MentalModelTrigger{}
// checks if the MentalModelTriggerInput type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MentalModelTriggerInput{}
// MentalModelTrigger Trigger settings for a mental model.
type MentalModelTrigger struct {
// MentalModelTriggerInput Trigger settings for a mental model.
type MentalModelTriggerInput struct {
// If true, refresh this mental model after observations consolidation (real-time mode)
RefreshAfterConsolidation *bool `json:"refresh_after_consolidation,omitempty"`
FactTypes []string `json:"fact_types,omitempty"`
// If true, exclude all mental models from the reflect loop (skip search_mental_models tool).
ExcludeMentalModels *bool `json:"exclude_mental_models,omitempty"`
ExcludeMentalModelIds []string `json:"exclude_mental_model_ids,omitempty"`
TagsMatch NullableString `json:"tags_match,omitempty"`
TagGroups []MentalModelTriggerInputTagGroupsInner `json:"tag_groups,omitempty"`
}
// NewMentalModelTrigger instantiates a new MentalModelTrigger object
// NewMentalModelTriggerInput instantiates a new MentalModelTriggerInput object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewMentalModelTrigger() *MentalModelTrigger {
this := MentalModelTrigger{}
func NewMentalModelTriggerInput() *MentalModelTriggerInput {
this := MentalModelTriggerInput{}
var refreshAfterConsolidation bool = false
this.RefreshAfterConsolidation = &refreshAfterConsolidation
var excludeMentalModels bool = false
@ -40,11 +42,11 @@ func NewMentalModelTrigger() *MentalModelTrigger {
return &this
}
// NewMentalModelTriggerWithDefaults instantiates a new MentalModelTrigger object
// NewMentalModelTriggerInputWithDefaults instantiates a new MentalModelTriggerInput object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewMentalModelTriggerWithDefaults() *MentalModelTrigger {
this := MentalModelTrigger{}
func NewMentalModelTriggerInputWithDefaults() *MentalModelTriggerInput {
this := MentalModelTriggerInput{}
var refreshAfterConsolidation bool = false
this.RefreshAfterConsolidation = &refreshAfterConsolidation
var excludeMentalModels bool = false
@ -53,7 +55,7 @@ func NewMentalModelTriggerWithDefaults() *MentalModelTrigger {
}
// GetRefreshAfterConsolidation returns the RefreshAfterConsolidation field value if set, zero value otherwise.
func (o *MentalModelTrigger) GetRefreshAfterConsolidation() bool {
func (o *MentalModelTriggerInput) GetRefreshAfterConsolidation() bool {
if o == nil || IsNil(o.RefreshAfterConsolidation) {
var ret bool
return ret
@ -63,7 +65,7 @@ func (o *MentalModelTrigger) GetRefreshAfterConsolidation() bool {
// GetRefreshAfterConsolidationOk returns a tuple with the RefreshAfterConsolidation field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MentalModelTrigger) GetRefreshAfterConsolidationOk() (*bool, bool) {
func (o *MentalModelTriggerInput) GetRefreshAfterConsolidationOk() (*bool, bool) {
if o == nil || IsNil(o.RefreshAfterConsolidation) {
return nil, false
}
@ -71,7 +73,7 @@ func (o *MentalModelTrigger) GetRefreshAfterConsolidationOk() (*bool, bool) {
}
// HasRefreshAfterConsolidation returns a boolean if a field has been set.
func (o *MentalModelTrigger) HasRefreshAfterConsolidation() bool {
func (o *MentalModelTriggerInput) HasRefreshAfterConsolidation() bool {
if o != nil && !IsNil(o.RefreshAfterConsolidation) {
return true
}
@ -80,12 +82,12 @@ func (o *MentalModelTrigger) HasRefreshAfterConsolidation() bool {
}
// SetRefreshAfterConsolidation gets a reference to the given bool and assigns it to the RefreshAfterConsolidation field.
func (o *MentalModelTrigger) SetRefreshAfterConsolidation(v bool) {
func (o *MentalModelTriggerInput) SetRefreshAfterConsolidation(v bool) {
o.RefreshAfterConsolidation = &v
}
// GetFactTypes returns the FactTypes field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MentalModelTrigger) GetFactTypes() []string {
func (o *MentalModelTriggerInput) GetFactTypes() []string {
if o == nil {
var ret []string
return ret
@ -96,7 +98,7 @@ func (o *MentalModelTrigger) GetFactTypes() []string {
// GetFactTypesOk returns a tuple with the FactTypes field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MentalModelTrigger) GetFactTypesOk() ([]string, bool) {
func (o *MentalModelTriggerInput) GetFactTypesOk() ([]string, bool) {
if o == nil || IsNil(o.FactTypes) {
return nil, false
}
@ -104,7 +106,7 @@ func (o *MentalModelTrigger) GetFactTypesOk() ([]string, bool) {
}
// HasFactTypes returns a boolean if a field has been set.
func (o *MentalModelTrigger) HasFactTypes() bool {
func (o *MentalModelTriggerInput) HasFactTypes() bool {
if o != nil && !IsNil(o.FactTypes) {
return true
}
@ -113,12 +115,12 @@ func (o *MentalModelTrigger) HasFactTypes() bool {
}
// SetFactTypes gets a reference to the given []string and assigns it to the FactTypes field.
func (o *MentalModelTrigger) SetFactTypes(v []string) {
func (o *MentalModelTriggerInput) SetFactTypes(v []string) {
o.FactTypes = v
}
// GetExcludeMentalModels returns the ExcludeMentalModels field value if set, zero value otherwise.
func (o *MentalModelTrigger) GetExcludeMentalModels() bool {
func (o *MentalModelTriggerInput) GetExcludeMentalModels() bool {
if o == nil || IsNil(o.ExcludeMentalModels) {
var ret bool
return ret
@ -128,7 +130,7 @@ func (o *MentalModelTrigger) GetExcludeMentalModels() bool {
// GetExcludeMentalModelsOk returns a tuple with the ExcludeMentalModels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MentalModelTrigger) GetExcludeMentalModelsOk() (*bool, bool) {
func (o *MentalModelTriggerInput) GetExcludeMentalModelsOk() (*bool, bool) {
if o == nil || IsNil(o.ExcludeMentalModels) {
return nil, false
}
@ -136,7 +138,7 @@ func (o *MentalModelTrigger) GetExcludeMentalModelsOk() (*bool, bool) {
}
// HasExcludeMentalModels returns a boolean if a field has been set.
func (o *MentalModelTrigger) HasExcludeMentalModels() bool {
func (o *MentalModelTriggerInput) HasExcludeMentalModels() bool {
if o != nil && !IsNil(o.ExcludeMentalModels) {
return true
}
@ -145,12 +147,12 @@ func (o *MentalModelTrigger) HasExcludeMentalModels() bool {
}
// SetExcludeMentalModels gets a reference to the given bool and assigns it to the ExcludeMentalModels field.
func (o *MentalModelTrigger) SetExcludeMentalModels(v bool) {
func (o *MentalModelTriggerInput) SetExcludeMentalModels(v bool) {
o.ExcludeMentalModels = &v
}
// GetExcludeMentalModelIds returns the ExcludeMentalModelIds field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MentalModelTrigger) GetExcludeMentalModelIds() []string {
func (o *MentalModelTriggerInput) GetExcludeMentalModelIds() []string {
if o == nil {
var ret []string
return ret
@ -161,7 +163,7 @@ func (o *MentalModelTrigger) GetExcludeMentalModelIds() []string {
// GetExcludeMentalModelIdsOk returns a tuple with the ExcludeMentalModelIds field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MentalModelTrigger) GetExcludeMentalModelIdsOk() ([]string, bool) {
func (o *MentalModelTriggerInput) GetExcludeMentalModelIdsOk() ([]string, bool) {
if o == nil || IsNil(o.ExcludeMentalModelIds) {
return nil, false
}
@ -169,7 +171,7 @@ func (o *MentalModelTrigger) GetExcludeMentalModelIdsOk() ([]string, bool) {
}
// HasExcludeMentalModelIds returns a boolean if a field has been set.
func (o *MentalModelTrigger) HasExcludeMentalModelIds() bool {
func (o *MentalModelTriggerInput) HasExcludeMentalModelIds() bool {
if o != nil && !IsNil(o.ExcludeMentalModelIds) {
return true
}
@ -178,11 +180,86 @@ func (o *MentalModelTrigger) HasExcludeMentalModelIds() bool {
}
// SetExcludeMentalModelIds gets a reference to the given []string and assigns it to the ExcludeMentalModelIds field.
func (o *MentalModelTrigger) SetExcludeMentalModelIds(v []string) {
func (o *MentalModelTriggerInput) SetExcludeMentalModelIds(v []string) {
o.ExcludeMentalModelIds = v
}
func (o MentalModelTrigger) MarshalJSON() ([]byte, error) {
// GetTagsMatch returns the TagsMatch field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MentalModelTriggerInput) GetTagsMatch() string {
if o == nil || IsNil(o.TagsMatch.Get()) {
var ret string
return ret
}
return *o.TagsMatch.Get()
}
// GetTagsMatchOk returns a tuple with the TagsMatch field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MentalModelTriggerInput) GetTagsMatchOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.TagsMatch.Get(), o.TagsMatch.IsSet()
}
// HasTagsMatch returns a boolean if a field has been set.
func (o *MentalModelTriggerInput) HasTagsMatch() bool {
if o != nil && o.TagsMatch.IsSet() {
return true
}
return false
}
// SetTagsMatch gets a reference to the given NullableString and assigns it to the TagsMatch field.
func (o *MentalModelTriggerInput) SetTagsMatch(v string) {
o.TagsMatch.Set(&v)
}
// SetTagsMatchNil sets the value for TagsMatch to be an explicit nil
func (o *MentalModelTriggerInput) SetTagsMatchNil() {
o.TagsMatch.Set(nil)
}
// UnsetTagsMatch ensures that no value is present for TagsMatch, not even an explicit nil
func (o *MentalModelTriggerInput) UnsetTagsMatch() {
o.TagsMatch.Unset()
}
// GetTagGroups returns the TagGroups field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MentalModelTriggerInput) GetTagGroups() []MentalModelTriggerInputTagGroupsInner {
if o == nil {
var ret []MentalModelTriggerInputTagGroupsInner
return ret
}
return o.TagGroups
}
// GetTagGroupsOk returns a tuple with the TagGroups field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MentalModelTriggerInput) GetTagGroupsOk() ([]MentalModelTriggerInputTagGroupsInner, bool) {
if o == nil || IsNil(o.TagGroups) {
return nil, false
}
return o.TagGroups, true
}
// HasTagGroups returns a boolean if a field has been set.
func (o *MentalModelTriggerInput) HasTagGroups() bool {
if o != nil && !IsNil(o.TagGroups) {
return true
}
return false
}
// SetTagGroups gets a reference to the given []MentalModelTriggerInputTagGroupsInner and assigns it to the TagGroups field.
func (o *MentalModelTriggerInput) SetTagGroups(v []MentalModelTriggerInputTagGroupsInner) {
o.TagGroups = v
}
func (o MentalModelTriggerInput) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
@ -190,7 +267,7 @@ func (o MentalModelTrigger) MarshalJSON() ([]byte, error) {
return json.Marshal(toSerialize)
}
func (o MentalModelTrigger) ToMap() (map[string]interface{}, error) {
func (o MentalModelTriggerInput) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.RefreshAfterConsolidation) {
toSerialize["refresh_after_consolidation"] = o.RefreshAfterConsolidation
@ -204,41 +281,47 @@ func (o MentalModelTrigger) ToMap() (map[string]interface{}, error) {
if o.ExcludeMentalModelIds != nil {
toSerialize["exclude_mental_model_ids"] = o.ExcludeMentalModelIds
}
if o.TagsMatch.IsSet() {
toSerialize["tags_match"] = o.TagsMatch.Get()
}
if o.TagGroups != nil {
toSerialize["tag_groups"] = o.TagGroups
}
return toSerialize, nil
}
type NullableMentalModelTrigger struct {
value *MentalModelTrigger
type NullableMentalModelTriggerInput struct {
value *MentalModelTriggerInput
isSet bool
}
func (v NullableMentalModelTrigger) Get() *MentalModelTrigger {
func (v NullableMentalModelTriggerInput) Get() *MentalModelTriggerInput {
return v.value
}
func (v *NullableMentalModelTrigger) Set(val *MentalModelTrigger) {
func (v *NullableMentalModelTriggerInput) Set(val *MentalModelTriggerInput) {
v.value = val
v.isSet = true
}
func (v NullableMentalModelTrigger) IsSet() bool {
func (v NullableMentalModelTriggerInput) IsSet() bool {
return v.isSet
}
func (v *NullableMentalModelTrigger) Unset() {
func (v *NullableMentalModelTriggerInput) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMentalModelTrigger(val *MentalModelTrigger) *NullableMentalModelTrigger {
return &NullableMentalModelTrigger{value: val, isSet: true}
func NewNullableMentalModelTriggerInput(val *MentalModelTriggerInput) *NullableMentalModelTriggerInput {
return &NullableMentalModelTriggerInput{value: val, isSet: true}
}
func (v NullableMentalModelTrigger) MarshalJSON() ([]byte, error) {
func (v NullableMentalModelTriggerInput) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMentalModelTrigger) UnmarshalJSON(src []byte) error {
func (v *NullableMentalModelTriggerInput) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,143 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.21
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"fmt"
)
// MentalModelTriggerInputTagGroupsInner struct for MentalModelTriggerInputTagGroupsInner
type MentalModelTriggerInputTagGroupsInner struct {
TagGroupAndInput *TagGroupAndInput
TagGroupLeaf *TagGroupLeaf
TagGroupNotInput *TagGroupNotInput
TagGroupOrInput *TagGroupOrInput
}
// Unmarshal JSON data into any of the pointers in the struct
func (dst *MentalModelTriggerInputTagGroupsInner) UnmarshalJSON(data []byte) error {
var err error
// try to unmarshal JSON data into TagGroupAndInput
err = json.Unmarshal(data, &dst.TagGroupAndInput);
if err == nil {
jsonTagGroupAndInput, _ := json.Marshal(dst.TagGroupAndInput)
if string(jsonTagGroupAndInput) == "{}" { // empty struct
dst.TagGroupAndInput = nil
} else {
return nil // data stored in dst.TagGroupAndInput, return on the first match
}
} else {
dst.TagGroupAndInput = nil
}
// try to unmarshal JSON data into TagGroupLeaf
err = json.Unmarshal(data, &dst.TagGroupLeaf);
if err == nil {
jsonTagGroupLeaf, _ := json.Marshal(dst.TagGroupLeaf)
if string(jsonTagGroupLeaf) == "{}" { // empty struct
dst.TagGroupLeaf = nil
} else {
return nil // data stored in dst.TagGroupLeaf, return on the first match
}
} else {
dst.TagGroupLeaf = nil
}
// try to unmarshal JSON data into TagGroupNotInput
err = json.Unmarshal(data, &dst.TagGroupNotInput);
if err == nil {
jsonTagGroupNotInput, _ := json.Marshal(dst.TagGroupNotInput)
if string(jsonTagGroupNotInput) == "{}" { // empty struct
dst.TagGroupNotInput = nil
} else {
return nil // data stored in dst.TagGroupNotInput, return on the first match
}
} else {
dst.TagGroupNotInput = nil
}
// try to unmarshal JSON data into TagGroupOrInput
err = json.Unmarshal(data, &dst.TagGroupOrInput);
if err == nil {
jsonTagGroupOrInput, _ := json.Marshal(dst.TagGroupOrInput)
if string(jsonTagGroupOrInput) == "{}" { // empty struct
dst.TagGroupOrInput = nil
} else {
return nil // data stored in dst.TagGroupOrInput, return on the first match
}
} else {
dst.TagGroupOrInput = nil
}
return fmt.Errorf("data failed to match schemas in anyOf(MentalModelTriggerInputTagGroupsInner)")
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src *MentalModelTriggerInputTagGroupsInner) MarshalJSON() ([]byte, error) {
if src.TagGroupAndInput != nil {
return json.Marshal(&src.TagGroupAndInput)
}
if src.TagGroupLeaf != nil {
return json.Marshal(&src.TagGroupLeaf)
}
if src.TagGroupNotInput != nil {
return json.Marshal(&src.TagGroupNotInput)
}
if src.TagGroupOrInput != nil {
return json.Marshal(&src.TagGroupOrInput)
}
return nil, nil // no data in anyOf schemas
}
type NullableMentalModelTriggerInputTagGroupsInner struct {
value *MentalModelTriggerInputTagGroupsInner
isSet bool
}
func (v NullableMentalModelTriggerInputTagGroupsInner) Get() *MentalModelTriggerInputTagGroupsInner {
return v.value
}
func (v *NullableMentalModelTriggerInputTagGroupsInner) Set(val *MentalModelTriggerInputTagGroupsInner) {
v.value = val
v.isSet = true
}
func (v NullableMentalModelTriggerInputTagGroupsInner) IsSet() bool {
return v.isSet
}
func (v *NullableMentalModelTriggerInputTagGroupsInner) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMentalModelTriggerInputTagGroupsInner(val *MentalModelTriggerInputTagGroupsInner) *NullableMentalModelTriggerInputTagGroupsInner {
return &NullableMentalModelTriggerInputTagGroupsInner{value: val, isSet: true}
}
func (v NullableMentalModelTriggerInputTagGroupsInner) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMentalModelTriggerInputTagGroupsInner) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,329 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.21
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
)
// checks if the MentalModelTriggerOutput type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MentalModelTriggerOutput{}
// MentalModelTriggerOutput Trigger settings for a mental model.
type MentalModelTriggerOutput struct {
// If true, refresh this mental model after observations consolidation (real-time mode)
RefreshAfterConsolidation *bool `json:"refresh_after_consolidation,omitempty"`
FactTypes []string `json:"fact_types,omitempty"`
// If true, exclude all mental models from the reflect loop (skip search_mental_models tool).
ExcludeMentalModels *bool `json:"exclude_mental_models,omitempty"`
ExcludeMentalModelIds []string `json:"exclude_mental_model_ids,omitempty"`
TagsMatch NullableString `json:"tags_match,omitempty"`
TagGroups []MentalModelTriggerOutputTagGroupsInner `json:"tag_groups,omitempty"`
}
// NewMentalModelTriggerOutput instantiates a new MentalModelTriggerOutput object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewMentalModelTriggerOutput() *MentalModelTriggerOutput {
this := MentalModelTriggerOutput{}
var refreshAfterConsolidation bool = false
this.RefreshAfterConsolidation = &refreshAfterConsolidation
var excludeMentalModels bool = false
this.ExcludeMentalModels = &excludeMentalModels
return &this
}
// NewMentalModelTriggerOutputWithDefaults instantiates a new MentalModelTriggerOutput object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewMentalModelTriggerOutputWithDefaults() *MentalModelTriggerOutput {
this := MentalModelTriggerOutput{}
var refreshAfterConsolidation bool = false
this.RefreshAfterConsolidation = &refreshAfterConsolidation
var excludeMentalModels bool = false
this.ExcludeMentalModels = &excludeMentalModels
return &this
}
// GetRefreshAfterConsolidation returns the RefreshAfterConsolidation field value if set, zero value otherwise.
func (o *MentalModelTriggerOutput) GetRefreshAfterConsolidation() bool {
if o == nil || IsNil(o.RefreshAfterConsolidation) {
var ret bool
return ret
}
return *o.RefreshAfterConsolidation
}
// GetRefreshAfterConsolidationOk returns a tuple with the RefreshAfterConsolidation field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MentalModelTriggerOutput) GetRefreshAfterConsolidationOk() (*bool, bool) {
if o == nil || IsNil(o.RefreshAfterConsolidation) {
return nil, false
}
return o.RefreshAfterConsolidation, true
}
// HasRefreshAfterConsolidation returns a boolean if a field has been set.
func (o *MentalModelTriggerOutput) HasRefreshAfterConsolidation() bool {
if o != nil && !IsNil(o.RefreshAfterConsolidation) {
return true
}
return false
}
// SetRefreshAfterConsolidation gets a reference to the given bool and assigns it to the RefreshAfterConsolidation field.
func (o *MentalModelTriggerOutput) SetRefreshAfterConsolidation(v bool) {
o.RefreshAfterConsolidation = &v
}
// GetFactTypes returns the FactTypes field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MentalModelTriggerOutput) GetFactTypes() []string {
if o == nil {
var ret []string
return ret
}
return o.FactTypes
}
// GetFactTypesOk returns a tuple with the FactTypes field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MentalModelTriggerOutput) GetFactTypesOk() ([]string, bool) {
if o == nil || IsNil(o.FactTypes) {
return nil, false
}
return o.FactTypes, true
}
// HasFactTypes returns a boolean if a field has been set.
func (o *MentalModelTriggerOutput) HasFactTypes() bool {
if o != nil && !IsNil(o.FactTypes) {
return true
}
return false
}
// SetFactTypes gets a reference to the given []string and assigns it to the FactTypes field.
func (o *MentalModelTriggerOutput) SetFactTypes(v []string) {
o.FactTypes = v
}
// GetExcludeMentalModels returns the ExcludeMentalModels field value if set, zero value otherwise.
func (o *MentalModelTriggerOutput) GetExcludeMentalModels() bool {
if o == nil || IsNil(o.ExcludeMentalModels) {
var ret bool
return ret
}
return *o.ExcludeMentalModels
}
// GetExcludeMentalModelsOk returns a tuple with the ExcludeMentalModels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MentalModelTriggerOutput) GetExcludeMentalModelsOk() (*bool, bool) {
if o == nil || IsNil(o.ExcludeMentalModels) {
return nil, false
}
return o.ExcludeMentalModels, true
}
// HasExcludeMentalModels returns a boolean if a field has been set.
func (o *MentalModelTriggerOutput) HasExcludeMentalModels() bool {
if o != nil && !IsNil(o.ExcludeMentalModels) {
return true
}
return false
}
// SetExcludeMentalModels gets a reference to the given bool and assigns it to the ExcludeMentalModels field.
func (o *MentalModelTriggerOutput) SetExcludeMentalModels(v bool) {
o.ExcludeMentalModels = &v
}
// GetExcludeMentalModelIds returns the ExcludeMentalModelIds field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MentalModelTriggerOutput) GetExcludeMentalModelIds() []string {
if o == nil {
var ret []string
return ret
}
return o.ExcludeMentalModelIds
}
// GetExcludeMentalModelIdsOk returns a tuple with the ExcludeMentalModelIds field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MentalModelTriggerOutput) GetExcludeMentalModelIdsOk() ([]string, bool) {
if o == nil || IsNil(o.ExcludeMentalModelIds) {
return nil, false
}
return o.ExcludeMentalModelIds, true
}
// HasExcludeMentalModelIds returns a boolean if a field has been set.
func (o *MentalModelTriggerOutput) HasExcludeMentalModelIds() bool {
if o != nil && !IsNil(o.ExcludeMentalModelIds) {
return true
}
return false
}
// SetExcludeMentalModelIds gets a reference to the given []string and assigns it to the ExcludeMentalModelIds field.
func (o *MentalModelTriggerOutput) SetExcludeMentalModelIds(v []string) {
o.ExcludeMentalModelIds = v
}
// GetTagsMatch returns the TagsMatch field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MentalModelTriggerOutput) GetTagsMatch() string {
if o == nil || IsNil(o.TagsMatch.Get()) {
var ret string
return ret
}
return *o.TagsMatch.Get()
}
// GetTagsMatchOk returns a tuple with the TagsMatch field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MentalModelTriggerOutput) GetTagsMatchOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.TagsMatch.Get(), o.TagsMatch.IsSet()
}
// HasTagsMatch returns a boolean if a field has been set.
func (o *MentalModelTriggerOutput) HasTagsMatch() bool {
if o != nil && o.TagsMatch.IsSet() {
return true
}
return false
}
// SetTagsMatch gets a reference to the given NullableString and assigns it to the TagsMatch field.
func (o *MentalModelTriggerOutput) SetTagsMatch(v string) {
o.TagsMatch.Set(&v)
}
// SetTagsMatchNil sets the value for TagsMatch to be an explicit nil
func (o *MentalModelTriggerOutput) SetTagsMatchNil() {
o.TagsMatch.Set(nil)
}
// UnsetTagsMatch ensures that no value is present for TagsMatch, not even an explicit nil
func (o *MentalModelTriggerOutput) UnsetTagsMatch() {
o.TagsMatch.Unset()
}
// GetTagGroups returns the TagGroups field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MentalModelTriggerOutput) GetTagGroups() []MentalModelTriggerOutputTagGroupsInner {
if o == nil {
var ret []MentalModelTriggerOutputTagGroupsInner
return ret
}
return o.TagGroups
}
// GetTagGroupsOk returns a tuple with the TagGroups field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MentalModelTriggerOutput) GetTagGroupsOk() ([]MentalModelTriggerOutputTagGroupsInner, bool) {
if o == nil || IsNil(o.TagGroups) {
return nil, false
}
return o.TagGroups, true
}
// HasTagGroups returns a boolean if a field has been set.
func (o *MentalModelTriggerOutput) HasTagGroups() bool {
if o != nil && !IsNil(o.TagGroups) {
return true
}
return false
}
// SetTagGroups gets a reference to the given []MentalModelTriggerOutputTagGroupsInner and assigns it to the TagGroups field.
func (o *MentalModelTriggerOutput) SetTagGroups(v []MentalModelTriggerOutputTagGroupsInner) {
o.TagGroups = v
}
func (o MentalModelTriggerOutput) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MentalModelTriggerOutput) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.RefreshAfterConsolidation) {
toSerialize["refresh_after_consolidation"] = o.RefreshAfterConsolidation
}
if o.FactTypes != nil {
toSerialize["fact_types"] = o.FactTypes
}
if !IsNil(o.ExcludeMentalModels) {
toSerialize["exclude_mental_models"] = o.ExcludeMentalModels
}
if o.ExcludeMentalModelIds != nil {
toSerialize["exclude_mental_model_ids"] = o.ExcludeMentalModelIds
}
if o.TagsMatch.IsSet() {
toSerialize["tags_match"] = o.TagsMatch.Get()
}
if o.TagGroups != nil {
toSerialize["tag_groups"] = o.TagGroups
}
return toSerialize, nil
}
type NullableMentalModelTriggerOutput struct {
value *MentalModelTriggerOutput
isSet bool
}
func (v NullableMentalModelTriggerOutput) Get() *MentalModelTriggerOutput {
return v.value
}
func (v *NullableMentalModelTriggerOutput) Set(val *MentalModelTriggerOutput) {
v.value = val
v.isSet = true
}
func (v NullableMentalModelTriggerOutput) IsSet() bool {
return v.isSet
}
func (v *NullableMentalModelTriggerOutput) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMentalModelTriggerOutput(val *MentalModelTriggerOutput) *NullableMentalModelTriggerOutput {
return &NullableMentalModelTriggerOutput{value: val, isSet: true}
}
func (v NullableMentalModelTriggerOutput) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMentalModelTriggerOutput) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,143 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.21
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"fmt"
)
// MentalModelTriggerOutputTagGroupsInner struct for MentalModelTriggerOutputTagGroupsInner
type MentalModelTriggerOutputTagGroupsInner struct {
TagGroupAndOutput *TagGroupAndOutput
TagGroupLeaf *TagGroupLeaf
TagGroupNotOutput *TagGroupNotOutput
TagGroupOrOutput *TagGroupOrOutput
}
// Unmarshal JSON data into any of the pointers in the struct
func (dst *MentalModelTriggerOutputTagGroupsInner) UnmarshalJSON(data []byte) error {
var err error
// try to unmarshal JSON data into TagGroupAndOutput
err = json.Unmarshal(data, &dst.TagGroupAndOutput);
if err == nil {
jsonTagGroupAndOutput, _ := json.Marshal(dst.TagGroupAndOutput)
if string(jsonTagGroupAndOutput) == "{}" { // empty struct
dst.TagGroupAndOutput = nil
} else {
return nil // data stored in dst.TagGroupAndOutput, return on the first match
}
} else {
dst.TagGroupAndOutput = nil
}
// try to unmarshal JSON data into TagGroupLeaf
err = json.Unmarshal(data, &dst.TagGroupLeaf);
if err == nil {
jsonTagGroupLeaf, _ := json.Marshal(dst.TagGroupLeaf)
if string(jsonTagGroupLeaf) == "{}" { // empty struct
dst.TagGroupLeaf = nil
} else {
return nil // data stored in dst.TagGroupLeaf, return on the first match
}
} else {
dst.TagGroupLeaf = nil
}
// try to unmarshal JSON data into TagGroupNotOutput
err = json.Unmarshal(data, &dst.TagGroupNotOutput);
if err == nil {
jsonTagGroupNotOutput, _ := json.Marshal(dst.TagGroupNotOutput)
if string(jsonTagGroupNotOutput) == "{}" { // empty struct
dst.TagGroupNotOutput = nil
} else {
return nil // data stored in dst.TagGroupNotOutput, return on the first match
}
} else {
dst.TagGroupNotOutput = nil
}
// try to unmarshal JSON data into TagGroupOrOutput
err = json.Unmarshal(data, &dst.TagGroupOrOutput);
if err == nil {
jsonTagGroupOrOutput, _ := json.Marshal(dst.TagGroupOrOutput)
if string(jsonTagGroupOrOutput) == "{}" { // empty struct
dst.TagGroupOrOutput = nil
} else {
return nil // data stored in dst.TagGroupOrOutput, return on the first match
}
} else {
dst.TagGroupOrOutput = nil
}
return fmt.Errorf("data failed to match schemas in anyOf(MentalModelTriggerOutputTagGroupsInner)")
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src *MentalModelTriggerOutputTagGroupsInner) MarshalJSON() ([]byte, error) {
if src.TagGroupAndOutput != nil {
return json.Marshal(&src.TagGroupAndOutput)
}
if src.TagGroupLeaf != nil {
return json.Marshal(&src.TagGroupLeaf)
}
if src.TagGroupNotOutput != nil {
return json.Marshal(&src.TagGroupNotOutput)
}
if src.TagGroupOrOutput != nil {
return json.Marshal(&src.TagGroupOrOutput)
}
return nil, nil // no data in anyOf schemas
}
type NullableMentalModelTriggerOutputTagGroupsInner struct {
value *MentalModelTriggerOutputTagGroupsInner
isSet bool
}
func (v NullableMentalModelTriggerOutputTagGroupsInner) Get() *MentalModelTriggerOutputTagGroupsInner {
return v.value
}
func (v *NullableMentalModelTriggerOutputTagGroupsInner) Set(val *MentalModelTriggerOutputTagGroupsInner) {
v.value = val
v.isSet = true
}
func (v NullableMentalModelTriggerOutputTagGroupsInner) IsSet() bool {
return v.isSet
}
func (v *NullableMentalModelTriggerOutputTagGroupsInner) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMentalModelTriggerOutputTagGroupsInner(val *MentalModelTriggerOutputTagGroupsInner) *NullableMentalModelTriggerOutputTagGroupsInner {
return &NullableMentalModelTriggerOutputTagGroupsInner{value: val, isSet: true}
}
func (v NullableMentalModelTriggerOutputTagGroupsInner) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMentalModelTriggerOutputTagGroupsInner) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -18,26 +18,26 @@ import (
// Not struct for Not
type Not struct {
TagGroupAnd *TagGroupAnd
TagGroupAndInput *TagGroupAndInput
TagGroupLeaf *TagGroupLeaf
TagGroupNot *TagGroupNot
TagGroupOr *TagGroupOr
TagGroupNotInput *TagGroupNotInput
TagGroupOrInput *TagGroupOrInput
}
// Unmarshal JSON data into any of the pointers in the struct
func (dst *Not) UnmarshalJSON(data []byte) error {
var err error
// try to unmarshal JSON data into TagGroupAnd
err = json.Unmarshal(data, &dst.TagGroupAnd);
// try to unmarshal JSON data into TagGroupAndInput
err = json.Unmarshal(data, &dst.TagGroupAndInput);
if err == nil {
jsonTagGroupAnd, _ := json.Marshal(dst.TagGroupAnd)
if string(jsonTagGroupAnd) == "{}" { // empty struct
dst.TagGroupAnd = nil
jsonTagGroupAndInput, _ := json.Marshal(dst.TagGroupAndInput)
if string(jsonTagGroupAndInput) == "{}" { // empty struct
dst.TagGroupAndInput = nil
} else {
return nil // data stored in dst.TagGroupAnd, return on the first match
return nil // data stored in dst.TagGroupAndInput, return on the first match
}
} else {
dst.TagGroupAnd = nil
dst.TagGroupAndInput = nil
}
// try to unmarshal JSON data into TagGroupLeaf
@ -53,30 +53,30 @@ func (dst *Not) UnmarshalJSON(data []byte) error {
dst.TagGroupLeaf = nil
}
// try to unmarshal JSON data into TagGroupNot
err = json.Unmarshal(data, &dst.TagGroupNot);
// try to unmarshal JSON data into TagGroupNotInput
err = json.Unmarshal(data, &dst.TagGroupNotInput);
if err == nil {
jsonTagGroupNot, _ := json.Marshal(dst.TagGroupNot)
if string(jsonTagGroupNot) == "{}" { // empty struct
dst.TagGroupNot = nil
jsonTagGroupNotInput, _ := json.Marshal(dst.TagGroupNotInput)
if string(jsonTagGroupNotInput) == "{}" { // empty struct
dst.TagGroupNotInput = nil
} else {
return nil // data stored in dst.TagGroupNot, return on the first match
return nil // data stored in dst.TagGroupNotInput, return on the first match
}
} else {
dst.TagGroupNot = nil
dst.TagGroupNotInput = nil
}
// try to unmarshal JSON data into TagGroupOr
err = json.Unmarshal(data, &dst.TagGroupOr);
// try to unmarshal JSON data into TagGroupOrInput
err = json.Unmarshal(data, &dst.TagGroupOrInput);
if err == nil {
jsonTagGroupOr, _ := json.Marshal(dst.TagGroupOr)
if string(jsonTagGroupOr) == "{}" { // empty struct
dst.TagGroupOr = nil
jsonTagGroupOrInput, _ := json.Marshal(dst.TagGroupOrInput)
if string(jsonTagGroupOrInput) == "{}" { // empty struct
dst.TagGroupOrInput = nil
} else {
return nil // data stored in dst.TagGroupOr, return on the first match
return nil // data stored in dst.TagGroupOrInput, return on the first match
}
} else {
dst.TagGroupOr = nil
dst.TagGroupOrInput = nil
}
return fmt.Errorf("data failed to match schemas in anyOf(Not)")
@ -84,20 +84,20 @@ func (dst *Not) UnmarshalJSON(data []byte) error {
// Marshal data from the first non-nil pointers in the struct to JSON
func (src *Not) MarshalJSON() ([]byte, error) {
if src.TagGroupAnd != nil {
return json.Marshal(&src.TagGroupAnd)
if src.TagGroupAndInput != nil {
return json.Marshal(&src.TagGroupAndInput)
}
if src.TagGroupLeaf != nil {
return json.Marshal(&src.TagGroupLeaf)
}
if src.TagGroupNot != nil {
return json.Marshal(&src.TagGroupNot)
if src.TagGroupNotInput != nil {
return json.Marshal(&src.TagGroupNotInput)
}
if src.TagGroupOr != nil {
return json.Marshal(&src.TagGroupOr)
if src.TagGroupOrInput != nil {
return json.Marshal(&src.TagGroupOrInput)
}
return nil, nil // no data in anyOf schemas

View file

@ -0,0 +1,143 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.21
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"fmt"
)
// Not1 struct for Not1
type Not1 struct {
TagGroupAndOutput *TagGroupAndOutput
TagGroupLeaf *TagGroupLeaf
TagGroupNotOutput *TagGroupNotOutput
TagGroupOrOutput *TagGroupOrOutput
}
// Unmarshal JSON data into any of the pointers in the struct
func (dst *Not1) UnmarshalJSON(data []byte) error {
var err error
// try to unmarshal JSON data into TagGroupAndOutput
err = json.Unmarshal(data, &dst.TagGroupAndOutput);
if err == nil {
jsonTagGroupAndOutput, _ := json.Marshal(dst.TagGroupAndOutput)
if string(jsonTagGroupAndOutput) == "{}" { // empty struct
dst.TagGroupAndOutput = nil
} else {
return nil // data stored in dst.TagGroupAndOutput, return on the first match
}
} else {
dst.TagGroupAndOutput = nil
}
// try to unmarshal JSON data into TagGroupLeaf
err = json.Unmarshal(data, &dst.TagGroupLeaf);
if err == nil {
jsonTagGroupLeaf, _ := json.Marshal(dst.TagGroupLeaf)
if string(jsonTagGroupLeaf) == "{}" { // empty struct
dst.TagGroupLeaf = nil
} else {
return nil // data stored in dst.TagGroupLeaf, return on the first match
}
} else {
dst.TagGroupLeaf = nil
}
// try to unmarshal JSON data into TagGroupNotOutput
err = json.Unmarshal(data, &dst.TagGroupNotOutput);
if err == nil {
jsonTagGroupNotOutput, _ := json.Marshal(dst.TagGroupNotOutput)
if string(jsonTagGroupNotOutput) == "{}" { // empty struct
dst.TagGroupNotOutput = nil
} else {
return nil // data stored in dst.TagGroupNotOutput, return on the first match
}
} else {
dst.TagGroupNotOutput = nil
}
// try to unmarshal JSON data into TagGroupOrOutput
err = json.Unmarshal(data, &dst.TagGroupOrOutput);
if err == nil {
jsonTagGroupOrOutput, _ := json.Marshal(dst.TagGroupOrOutput)
if string(jsonTagGroupOrOutput) == "{}" { // empty struct
dst.TagGroupOrOutput = nil
} else {
return nil // data stored in dst.TagGroupOrOutput, return on the first match
}
} else {
dst.TagGroupOrOutput = nil
}
return fmt.Errorf("data failed to match schemas in anyOf(Not1)")
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src *Not1) MarshalJSON() ([]byte, error) {
if src.TagGroupAndOutput != nil {
return json.Marshal(&src.TagGroupAndOutput)
}
if src.TagGroupLeaf != nil {
return json.Marshal(&src.TagGroupLeaf)
}
if src.TagGroupNotOutput != nil {
return json.Marshal(&src.TagGroupNotOutput)
}
if src.TagGroupOrOutput != nil {
return json.Marshal(&src.TagGroupOrOutput)
}
return nil, nil // no data in anyOf schemas
}
type NullableNot1 struct {
value *Not1
isSet bool
}
func (v NullableNot1) Get() *Not1 {
return v.value
}
func (v *NullableNot1) Set(val *Not1) {
v.value = val
v.isSet = true
}
func (v NullableNot1) IsSet() bool {
return v.isSet
}
func (v *NullableNot1) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNot1(val *Not1) *NullableNot1 {
return &NullableNot1{value: val, isSet: true}
}
func (v NullableNot1) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNot1) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -32,7 +32,7 @@ type RecallRequest struct {
Tags []string `json:"tags,omitempty"`
// How to match tags: 'any' (OR, includes untagged), 'all' (AND, includes untagged), 'any_strict' (OR, excludes untagged), 'all_strict' (AND, excludes untagged).
TagsMatch *string `json:"tags_match,omitempty"`
TagGroups []RecallRequestTagGroupsInner `json:"tag_groups,omitempty"`
TagGroups []MentalModelTriggerInputTagGroupsInner `json:"tag_groups,omitempty"`
}
type _RecallRequest RecallRequest
@ -360,9 +360,9 @@ func (o *RecallRequest) SetTagsMatch(v string) {
}
// GetTagGroups returns the TagGroups field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallRequest) GetTagGroups() []RecallRequestTagGroupsInner {
func (o *RecallRequest) GetTagGroups() []MentalModelTriggerInputTagGroupsInner {
if o == nil {
var ret []RecallRequestTagGroupsInner
var ret []MentalModelTriggerInputTagGroupsInner
return ret
}
return o.TagGroups
@ -371,7 +371,7 @@ func (o *RecallRequest) GetTagGroups() []RecallRequestTagGroupsInner {
// GetTagGroupsOk returns a tuple with the TagGroups field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallRequest) GetTagGroupsOk() ([]RecallRequestTagGroupsInner, bool) {
func (o *RecallRequest) GetTagGroupsOk() ([]MentalModelTriggerInputTagGroupsInner, bool) {
if o == nil || IsNil(o.TagGroups) {
return nil, false
}
@ -387,8 +387,8 @@ func (o *RecallRequest) HasTagGroups() bool {
return false
}
// SetTagGroups gets a reference to the given []RecallRequestTagGroupsInner and assigns it to the TagGroups field.
func (o *RecallRequest) SetTagGroups(v []RecallRequestTagGroupsInner) {
// SetTagGroups gets a reference to the given []MentalModelTriggerInputTagGroupsInner and assigns it to the TagGroups field.
func (o *RecallRequest) SetTagGroups(v []MentalModelTriggerInputTagGroupsInner) {
o.TagGroups = v
}

View file

@ -1,143 +0,0 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.21
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"fmt"
)
// RecallRequestTagGroupsInner struct for RecallRequestTagGroupsInner
type RecallRequestTagGroupsInner struct {
TagGroupAnd *TagGroupAnd
TagGroupLeaf *TagGroupLeaf
TagGroupNot *TagGroupNot
TagGroupOr *TagGroupOr
}
// Unmarshal JSON data into any of the pointers in the struct
func (dst *RecallRequestTagGroupsInner) UnmarshalJSON(data []byte) error {
var err error
// try to unmarshal JSON data into TagGroupAnd
err = json.Unmarshal(data, &dst.TagGroupAnd);
if err == nil {
jsonTagGroupAnd, _ := json.Marshal(dst.TagGroupAnd)
if string(jsonTagGroupAnd) == "{}" { // empty struct
dst.TagGroupAnd = nil
} else {
return nil // data stored in dst.TagGroupAnd, return on the first match
}
} else {
dst.TagGroupAnd = nil
}
// try to unmarshal JSON data into TagGroupLeaf
err = json.Unmarshal(data, &dst.TagGroupLeaf);
if err == nil {
jsonTagGroupLeaf, _ := json.Marshal(dst.TagGroupLeaf)
if string(jsonTagGroupLeaf) == "{}" { // empty struct
dst.TagGroupLeaf = nil
} else {
return nil // data stored in dst.TagGroupLeaf, return on the first match
}
} else {
dst.TagGroupLeaf = nil
}
// try to unmarshal JSON data into TagGroupNot
err = json.Unmarshal(data, &dst.TagGroupNot);
if err == nil {
jsonTagGroupNot, _ := json.Marshal(dst.TagGroupNot)
if string(jsonTagGroupNot) == "{}" { // empty struct
dst.TagGroupNot = nil
} else {
return nil // data stored in dst.TagGroupNot, return on the first match
}
} else {
dst.TagGroupNot = nil
}
// try to unmarshal JSON data into TagGroupOr
err = json.Unmarshal(data, &dst.TagGroupOr);
if err == nil {
jsonTagGroupOr, _ := json.Marshal(dst.TagGroupOr)
if string(jsonTagGroupOr) == "{}" { // empty struct
dst.TagGroupOr = nil
} else {
return nil // data stored in dst.TagGroupOr, return on the first match
}
} else {
dst.TagGroupOr = nil
}
return fmt.Errorf("data failed to match schemas in anyOf(RecallRequestTagGroupsInner)")
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src *RecallRequestTagGroupsInner) MarshalJSON() ([]byte, error) {
if src.TagGroupAnd != nil {
return json.Marshal(&src.TagGroupAnd)
}
if src.TagGroupLeaf != nil {
return json.Marshal(&src.TagGroupLeaf)
}
if src.TagGroupNot != nil {
return json.Marshal(&src.TagGroupNot)
}
if src.TagGroupOr != nil {
return json.Marshal(&src.TagGroupOr)
}
return nil, nil // no data in anyOf schemas
}
type NullableRecallRequestTagGroupsInner struct {
value *RecallRequestTagGroupsInner
isSet bool
}
func (v NullableRecallRequestTagGroupsInner) Get() *RecallRequestTagGroupsInner {
return v.value
}
func (v *NullableRecallRequestTagGroupsInner) Set(val *RecallRequestTagGroupsInner) {
v.value = val
v.isSet = true
}
func (v NullableRecallRequestTagGroupsInner) IsSet() bool {
return v.isSet
}
func (v *NullableRecallRequestTagGroupsInner) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRecallRequestTagGroupsInner(val *RecallRequestTagGroupsInner) *NullableRecallRequestTagGroupsInner {
return &NullableRecallRequestTagGroupsInner{value: val, isSet: true}
}
func (v NullableRecallRequestTagGroupsInner) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRecallRequestTagGroupsInner) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -32,7 +32,7 @@ type ReflectRequest struct {
Tags []string `json:"tags,omitempty"`
// How to match tags: 'any' (OR, includes untagged), 'all' (AND, includes untagged), 'any_strict' (OR, excludes untagged), 'all_strict' (AND, excludes untagged).
TagsMatch *string `json:"tags_match,omitempty"`
TagGroups []RecallRequestTagGroupsInner `json:"tag_groups,omitempty"`
TagGroups []MentalModelTriggerInputTagGroupsInner `json:"tag_groups,omitempty"`
FactTypes []string `json:"fact_types,omitempty"`
// If true, exclude all mental models from the reflect loop (skip search_mental_models tool).
ExcludeMentalModels *bool `json:"exclude_mental_models,omitempty"`
@ -332,9 +332,9 @@ func (o *ReflectRequest) SetTagsMatch(v string) {
}
// GetTagGroups returns the TagGroups field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectRequest) GetTagGroups() []RecallRequestTagGroupsInner {
func (o *ReflectRequest) GetTagGroups() []MentalModelTriggerInputTagGroupsInner {
if o == nil {
var ret []RecallRequestTagGroupsInner
var ret []MentalModelTriggerInputTagGroupsInner
return ret
}
return o.TagGroups
@ -343,7 +343,7 @@ func (o *ReflectRequest) GetTagGroups() []RecallRequestTagGroupsInner {
// GetTagGroupsOk returns a tuple with the TagGroups field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectRequest) GetTagGroupsOk() ([]RecallRequestTagGroupsInner, bool) {
func (o *ReflectRequest) GetTagGroupsOk() ([]MentalModelTriggerInputTagGroupsInner, bool) {
if o == nil || IsNil(o.TagGroups) {
return nil, false
}
@ -359,8 +359,8 @@ func (o *ReflectRequest) HasTagGroups() bool {
return false
}
// SetTagGroups gets a reference to the given []RecallRequestTagGroupsInner and assigns it to the TagGroups field.
func (o *ReflectRequest) SetTagGroups(v []RecallRequestTagGroupsInner) {
// SetTagGroups gets a reference to the given []MentalModelTriggerInputTagGroupsInner and assigns it to the TagGroups field.
func (o *ReflectRequest) SetTagGroups(v []MentalModelTriggerInputTagGroupsInner) {
o.TagGroups = v
}

View file

@ -16,38 +16,38 @@ import (
"fmt"
)
// checks if the TagGroupAnd type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TagGroupAnd{}
// checks if the TagGroupAndInput type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TagGroupAndInput{}
// TagGroupAnd Compound AND group: all child filters must match.
type TagGroupAnd struct {
And []RecallRequestTagGroupsInner `json:"and"`
// TagGroupAndInput Compound AND group: all child filters must match.
type TagGroupAndInput struct {
And []MentalModelTriggerInputTagGroupsInner `json:"and"`
}
type _TagGroupAnd TagGroupAnd
type _TagGroupAndInput TagGroupAndInput
// NewTagGroupAnd instantiates a new TagGroupAnd object
// NewTagGroupAndInput instantiates a new TagGroupAndInput object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewTagGroupAnd(and []RecallRequestTagGroupsInner) *TagGroupAnd {
this := TagGroupAnd{}
func NewTagGroupAndInput(and []MentalModelTriggerInputTagGroupsInner) *TagGroupAndInput {
this := TagGroupAndInput{}
this.And = and
return &this
}
// NewTagGroupAndWithDefaults instantiates a new TagGroupAnd object
// NewTagGroupAndInputWithDefaults instantiates a new TagGroupAndInput object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewTagGroupAndWithDefaults() *TagGroupAnd {
this := TagGroupAnd{}
func NewTagGroupAndInputWithDefaults() *TagGroupAndInput {
this := TagGroupAndInput{}
return &this
}
// GetAnd returns the And field value
func (o *TagGroupAnd) GetAnd() []RecallRequestTagGroupsInner {
func (o *TagGroupAndInput) GetAnd() []MentalModelTriggerInputTagGroupsInner {
if o == nil {
var ret []RecallRequestTagGroupsInner
var ret []MentalModelTriggerInputTagGroupsInner
return ret
}
@ -56,7 +56,7 @@ func (o *TagGroupAnd) GetAnd() []RecallRequestTagGroupsInner {
// GetAndOk returns a tuple with the And field value
// and a boolean to check if the value has been set.
func (o *TagGroupAnd) GetAndOk() ([]RecallRequestTagGroupsInner, bool) {
func (o *TagGroupAndInput) GetAndOk() ([]MentalModelTriggerInputTagGroupsInner, bool) {
if o == nil {
return nil, false
}
@ -64,11 +64,11 @@ func (o *TagGroupAnd) GetAndOk() ([]RecallRequestTagGroupsInner, bool) {
}
// SetAnd sets field value
func (o *TagGroupAnd) SetAnd(v []RecallRequestTagGroupsInner) {
func (o *TagGroupAndInput) SetAnd(v []MentalModelTriggerInputTagGroupsInner) {
o.And = v
}
func (o TagGroupAnd) MarshalJSON() ([]byte, error) {
func (o TagGroupAndInput) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
@ -76,13 +76,13 @@ func (o TagGroupAnd) MarshalJSON() ([]byte, error) {
return json.Marshal(toSerialize)
}
func (o TagGroupAnd) ToMap() (map[string]interface{}, error) {
func (o TagGroupAndInput) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["and"] = o.And
return toSerialize, nil
}
func (o *TagGroupAnd) UnmarshalJSON(data []byte) (err error) {
func (o *TagGroupAndInput) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
@ -104,53 +104,53 @@ func (o *TagGroupAnd) UnmarshalJSON(data []byte) (err error) {
}
}
varTagGroupAnd := _TagGroupAnd{}
varTagGroupAndInput := _TagGroupAndInput{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varTagGroupAnd)
err = decoder.Decode(&varTagGroupAndInput)
if err != nil {
return err
}
*o = TagGroupAnd(varTagGroupAnd)
*o = TagGroupAndInput(varTagGroupAndInput)
return err
}
type NullableTagGroupAnd struct {
value *TagGroupAnd
type NullableTagGroupAndInput struct {
value *TagGroupAndInput
isSet bool
}
func (v NullableTagGroupAnd) Get() *TagGroupAnd {
func (v NullableTagGroupAndInput) Get() *TagGroupAndInput {
return v.value
}
func (v *NullableTagGroupAnd) Set(val *TagGroupAnd) {
func (v *NullableTagGroupAndInput) Set(val *TagGroupAndInput) {
v.value = val
v.isSet = true
}
func (v NullableTagGroupAnd) IsSet() bool {
func (v NullableTagGroupAndInput) IsSet() bool {
return v.isSet
}
func (v *NullableTagGroupAnd) Unset() {
func (v *NullableTagGroupAndInput) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTagGroupAnd(val *TagGroupAnd) *NullableTagGroupAnd {
return &NullableTagGroupAnd{value: val, isSet: true}
func NewNullableTagGroupAndInput(val *TagGroupAndInput) *NullableTagGroupAndInput {
return &NullableTagGroupAndInput{value: val, isSet: true}
}
func (v NullableTagGroupAnd) MarshalJSON() ([]byte, error) {
func (v NullableTagGroupAndInput) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTagGroupAnd) UnmarshalJSON(src []byte) error {
func (v *NullableTagGroupAndInput) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,158 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.21
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the TagGroupAndOutput type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TagGroupAndOutput{}
// TagGroupAndOutput Compound AND group: all child filters must match.
type TagGroupAndOutput struct {
And []MentalModelTriggerOutputTagGroupsInner `json:"and"`
}
type _TagGroupAndOutput TagGroupAndOutput
// NewTagGroupAndOutput instantiates a new TagGroupAndOutput object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewTagGroupAndOutput(and []MentalModelTriggerOutputTagGroupsInner) *TagGroupAndOutput {
this := TagGroupAndOutput{}
this.And = and
return &this
}
// NewTagGroupAndOutputWithDefaults instantiates a new TagGroupAndOutput object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewTagGroupAndOutputWithDefaults() *TagGroupAndOutput {
this := TagGroupAndOutput{}
return &this
}
// GetAnd returns the And field value
func (o *TagGroupAndOutput) GetAnd() []MentalModelTriggerOutputTagGroupsInner {
if o == nil {
var ret []MentalModelTriggerOutputTagGroupsInner
return ret
}
return o.And
}
// GetAndOk returns a tuple with the And field value
// and a boolean to check if the value has been set.
func (o *TagGroupAndOutput) GetAndOk() ([]MentalModelTriggerOutputTagGroupsInner, bool) {
if o == nil {
return nil, false
}
return o.And, true
}
// SetAnd sets field value
func (o *TagGroupAndOutput) SetAnd(v []MentalModelTriggerOutputTagGroupsInner) {
o.And = v
}
func (o TagGroupAndOutput) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TagGroupAndOutput) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["and"] = o.And
return toSerialize, nil
}
func (o *TagGroupAndOutput) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"and",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varTagGroupAndOutput := _TagGroupAndOutput{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varTagGroupAndOutput)
if err != nil {
return err
}
*o = TagGroupAndOutput(varTagGroupAndOutput)
return err
}
type NullableTagGroupAndOutput struct {
value *TagGroupAndOutput
isSet bool
}
func (v NullableTagGroupAndOutput) Get() *TagGroupAndOutput {
return v.value
}
func (v *NullableTagGroupAndOutput) Set(val *TagGroupAndOutput) {
v.value = val
v.isSet = true
}
func (v NullableTagGroupAndOutput) IsSet() bool {
return v.isSet
}
func (v *NullableTagGroupAndOutput) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTagGroupAndOutput(val *TagGroupAndOutput) *NullableTagGroupAndOutput {
return &NullableTagGroupAndOutput{value: val, isSet: true}
}
func (v NullableTagGroupAndOutput) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTagGroupAndOutput) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -16,36 +16,36 @@ import (
"fmt"
)
// checks if the TagGroupNot type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TagGroupNot{}
// checks if the TagGroupNotInput type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TagGroupNotInput{}
// TagGroupNot Compound NOT group: child filter must NOT match.
type TagGroupNot struct {
// TagGroupNotInput Compound NOT group: child filter must NOT match.
type TagGroupNotInput struct {
Not Not `json:"not"`
}
type _TagGroupNot TagGroupNot
type _TagGroupNotInput TagGroupNotInput
// NewTagGroupNot instantiates a new TagGroupNot object
// NewTagGroupNotInput instantiates a new TagGroupNotInput object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewTagGroupNot(not Not) *TagGroupNot {
this := TagGroupNot{}
func NewTagGroupNotInput(not Not) *TagGroupNotInput {
this := TagGroupNotInput{}
this.Not = not
return &this
}
// NewTagGroupNotWithDefaults instantiates a new TagGroupNot object
// NewTagGroupNotInputWithDefaults instantiates a new TagGroupNotInput object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewTagGroupNotWithDefaults() *TagGroupNot {
this := TagGroupNot{}
func NewTagGroupNotInputWithDefaults() *TagGroupNotInput {
this := TagGroupNotInput{}
return &this
}
// GetNot returns the Not field value
func (o *TagGroupNot) GetNot() Not {
func (o *TagGroupNotInput) GetNot() Not {
if o == nil {
var ret Not
return ret
@ -56,7 +56,7 @@ func (o *TagGroupNot) GetNot() Not {
// GetNotOk returns a tuple with the Not field value
// and a boolean to check if the value has been set.
func (o *TagGroupNot) GetNotOk() (*Not, bool) {
func (o *TagGroupNotInput) GetNotOk() (*Not, bool) {
if o == nil {
return nil, false
}
@ -64,11 +64,11 @@ func (o *TagGroupNot) GetNotOk() (*Not, bool) {
}
// SetNot sets field value
func (o *TagGroupNot) SetNot(v Not) {
func (o *TagGroupNotInput) SetNot(v Not) {
o.Not = v
}
func (o TagGroupNot) MarshalJSON() ([]byte, error) {
func (o TagGroupNotInput) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
@ -76,13 +76,13 @@ func (o TagGroupNot) MarshalJSON() ([]byte, error) {
return json.Marshal(toSerialize)
}
func (o TagGroupNot) ToMap() (map[string]interface{}, error) {
func (o TagGroupNotInput) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["not"] = o.Not
return toSerialize, nil
}
func (o *TagGroupNot) UnmarshalJSON(data []byte) (err error) {
func (o *TagGroupNotInput) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
@ -104,53 +104,53 @@ func (o *TagGroupNot) UnmarshalJSON(data []byte) (err error) {
}
}
varTagGroupNot := _TagGroupNot{}
varTagGroupNotInput := _TagGroupNotInput{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varTagGroupNot)
err = decoder.Decode(&varTagGroupNotInput)
if err != nil {
return err
}
*o = TagGroupNot(varTagGroupNot)
*o = TagGroupNotInput(varTagGroupNotInput)
return err
}
type NullableTagGroupNot struct {
value *TagGroupNot
type NullableTagGroupNotInput struct {
value *TagGroupNotInput
isSet bool
}
func (v NullableTagGroupNot) Get() *TagGroupNot {
func (v NullableTagGroupNotInput) Get() *TagGroupNotInput {
return v.value
}
func (v *NullableTagGroupNot) Set(val *TagGroupNot) {
func (v *NullableTagGroupNotInput) Set(val *TagGroupNotInput) {
v.value = val
v.isSet = true
}
func (v NullableTagGroupNot) IsSet() bool {
func (v NullableTagGroupNotInput) IsSet() bool {
return v.isSet
}
func (v *NullableTagGroupNot) Unset() {
func (v *NullableTagGroupNotInput) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTagGroupNot(val *TagGroupNot) *NullableTagGroupNot {
return &NullableTagGroupNot{value: val, isSet: true}
func NewNullableTagGroupNotInput(val *TagGroupNotInput) *NullableTagGroupNotInput {
return &NullableTagGroupNotInput{value: val, isSet: true}
}
func (v NullableTagGroupNot) MarshalJSON() ([]byte, error) {
func (v NullableTagGroupNotInput) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTagGroupNot) UnmarshalJSON(src []byte) error {
func (v *NullableTagGroupNotInput) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,158 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.21
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the TagGroupNotOutput type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TagGroupNotOutput{}
// TagGroupNotOutput Compound NOT group: child filter must NOT match.
type TagGroupNotOutput struct {
Not Not1 `json:"not"`
}
type _TagGroupNotOutput TagGroupNotOutput
// NewTagGroupNotOutput instantiates a new TagGroupNotOutput object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewTagGroupNotOutput(not Not1) *TagGroupNotOutput {
this := TagGroupNotOutput{}
this.Not = not
return &this
}
// NewTagGroupNotOutputWithDefaults instantiates a new TagGroupNotOutput object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewTagGroupNotOutputWithDefaults() *TagGroupNotOutput {
this := TagGroupNotOutput{}
return &this
}
// GetNot returns the Not field value
func (o *TagGroupNotOutput) GetNot() Not1 {
if o == nil {
var ret Not1
return ret
}
return o.Not
}
// GetNotOk returns a tuple with the Not field value
// and a boolean to check if the value has been set.
func (o *TagGroupNotOutput) GetNotOk() (*Not1, bool) {
if o == nil {
return nil, false
}
return &o.Not, true
}
// SetNot sets field value
func (o *TagGroupNotOutput) SetNot(v Not1) {
o.Not = v
}
func (o TagGroupNotOutput) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TagGroupNotOutput) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["not"] = o.Not
return toSerialize, nil
}
func (o *TagGroupNotOutput) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"not",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varTagGroupNotOutput := _TagGroupNotOutput{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varTagGroupNotOutput)
if err != nil {
return err
}
*o = TagGroupNotOutput(varTagGroupNotOutput)
return err
}
type NullableTagGroupNotOutput struct {
value *TagGroupNotOutput
isSet bool
}
func (v NullableTagGroupNotOutput) Get() *TagGroupNotOutput {
return v.value
}
func (v *NullableTagGroupNotOutput) Set(val *TagGroupNotOutput) {
v.value = val
v.isSet = true
}
func (v NullableTagGroupNotOutput) IsSet() bool {
return v.isSet
}
func (v *NullableTagGroupNotOutput) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTagGroupNotOutput(val *TagGroupNotOutput) *NullableTagGroupNotOutput {
return &NullableTagGroupNotOutput{value: val, isSet: true}
}
func (v NullableTagGroupNotOutput) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTagGroupNotOutput) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -16,38 +16,38 @@ import (
"fmt"
)
// checks if the TagGroupOr type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TagGroupOr{}
// checks if the TagGroupOrInput type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TagGroupOrInput{}
// TagGroupOr Compound OR group: at least one child filter must match.
type TagGroupOr struct {
Or []RecallRequestTagGroupsInner `json:"or"`
// TagGroupOrInput Compound OR group: at least one child filter must match.
type TagGroupOrInput struct {
Or []MentalModelTriggerInputTagGroupsInner `json:"or"`
}
type _TagGroupOr TagGroupOr
type _TagGroupOrInput TagGroupOrInput
// NewTagGroupOr instantiates a new TagGroupOr object
// NewTagGroupOrInput instantiates a new TagGroupOrInput object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewTagGroupOr(or []RecallRequestTagGroupsInner) *TagGroupOr {
this := TagGroupOr{}
func NewTagGroupOrInput(or []MentalModelTriggerInputTagGroupsInner) *TagGroupOrInput {
this := TagGroupOrInput{}
this.Or = or
return &this
}
// NewTagGroupOrWithDefaults instantiates a new TagGroupOr object
// NewTagGroupOrInputWithDefaults instantiates a new TagGroupOrInput object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewTagGroupOrWithDefaults() *TagGroupOr {
this := TagGroupOr{}
func NewTagGroupOrInputWithDefaults() *TagGroupOrInput {
this := TagGroupOrInput{}
return &this
}
// GetOr returns the Or field value
func (o *TagGroupOr) GetOr() []RecallRequestTagGroupsInner {
func (o *TagGroupOrInput) GetOr() []MentalModelTriggerInputTagGroupsInner {
if o == nil {
var ret []RecallRequestTagGroupsInner
var ret []MentalModelTriggerInputTagGroupsInner
return ret
}
@ -56,7 +56,7 @@ func (o *TagGroupOr) GetOr() []RecallRequestTagGroupsInner {
// GetOrOk returns a tuple with the Or field value
// and a boolean to check if the value has been set.
func (o *TagGroupOr) GetOrOk() ([]RecallRequestTagGroupsInner, bool) {
func (o *TagGroupOrInput) GetOrOk() ([]MentalModelTriggerInputTagGroupsInner, bool) {
if o == nil {
return nil, false
}
@ -64,11 +64,11 @@ func (o *TagGroupOr) GetOrOk() ([]RecallRequestTagGroupsInner, bool) {
}
// SetOr sets field value
func (o *TagGroupOr) SetOr(v []RecallRequestTagGroupsInner) {
func (o *TagGroupOrInput) SetOr(v []MentalModelTriggerInputTagGroupsInner) {
o.Or = v
}
func (o TagGroupOr) MarshalJSON() ([]byte, error) {
func (o TagGroupOrInput) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
@ -76,13 +76,13 @@ func (o TagGroupOr) MarshalJSON() ([]byte, error) {
return json.Marshal(toSerialize)
}
func (o TagGroupOr) ToMap() (map[string]interface{}, error) {
func (o TagGroupOrInput) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["or"] = o.Or
return toSerialize, nil
}
func (o *TagGroupOr) UnmarshalJSON(data []byte) (err error) {
func (o *TagGroupOrInput) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
@ -104,53 +104,53 @@ func (o *TagGroupOr) UnmarshalJSON(data []byte) (err error) {
}
}
varTagGroupOr := _TagGroupOr{}
varTagGroupOrInput := _TagGroupOrInput{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varTagGroupOr)
err = decoder.Decode(&varTagGroupOrInput)
if err != nil {
return err
}
*o = TagGroupOr(varTagGroupOr)
*o = TagGroupOrInput(varTagGroupOrInput)
return err
}
type NullableTagGroupOr struct {
value *TagGroupOr
type NullableTagGroupOrInput struct {
value *TagGroupOrInput
isSet bool
}
func (v NullableTagGroupOr) Get() *TagGroupOr {
func (v NullableTagGroupOrInput) Get() *TagGroupOrInput {
return v.value
}
func (v *NullableTagGroupOr) Set(val *TagGroupOr) {
func (v *NullableTagGroupOrInput) Set(val *TagGroupOrInput) {
v.value = val
v.isSet = true
}
func (v NullableTagGroupOr) IsSet() bool {
func (v NullableTagGroupOrInput) IsSet() bool {
return v.isSet
}
func (v *NullableTagGroupOr) Unset() {
func (v *NullableTagGroupOrInput) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTagGroupOr(val *TagGroupOr) *NullableTagGroupOr {
return &NullableTagGroupOr{value: val, isSet: true}
func NewNullableTagGroupOrInput(val *TagGroupOrInput) *NullableTagGroupOrInput {
return &NullableTagGroupOrInput{value: val, isSet: true}
}
func (v NullableTagGroupOr) MarshalJSON() ([]byte, error) {
func (v NullableTagGroupOrInput) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTagGroupOr) UnmarshalJSON(src []byte) error {
func (v *NullableTagGroupOrInput) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,158 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.21
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the TagGroupOrOutput type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TagGroupOrOutput{}
// TagGroupOrOutput Compound OR group: at least one child filter must match.
type TagGroupOrOutput struct {
Or []MentalModelTriggerOutputTagGroupsInner `json:"or"`
}
type _TagGroupOrOutput TagGroupOrOutput
// NewTagGroupOrOutput instantiates a new TagGroupOrOutput object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewTagGroupOrOutput(or []MentalModelTriggerOutputTagGroupsInner) *TagGroupOrOutput {
this := TagGroupOrOutput{}
this.Or = or
return &this
}
// NewTagGroupOrOutputWithDefaults instantiates a new TagGroupOrOutput object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewTagGroupOrOutputWithDefaults() *TagGroupOrOutput {
this := TagGroupOrOutput{}
return &this
}
// GetOr returns the Or field value
func (o *TagGroupOrOutput) GetOr() []MentalModelTriggerOutputTagGroupsInner {
if o == nil {
var ret []MentalModelTriggerOutputTagGroupsInner
return ret
}
return o.Or
}
// GetOrOk returns a tuple with the Or field value
// and a boolean to check if the value has been set.
func (o *TagGroupOrOutput) GetOrOk() ([]MentalModelTriggerOutputTagGroupsInner, bool) {
if o == nil {
return nil, false
}
return o.Or, true
}
// SetOr sets field value
func (o *TagGroupOrOutput) SetOr(v []MentalModelTriggerOutputTagGroupsInner) {
o.Or = v
}
func (o TagGroupOrOutput) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TagGroupOrOutput) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["or"] = o.Or
return toSerialize, nil
}
func (o *TagGroupOrOutput) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"or",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varTagGroupOrOutput := _TagGroupOrOutput{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varTagGroupOrOutput)
if err != nil {
return err
}
*o = TagGroupOrOutput(varTagGroupOrOutput)
return err
}
type NullableTagGroupOrOutput struct {
value *TagGroupOrOutput
isSet bool
}
func (v NullableTagGroupOrOutput) Get() *TagGroupOrOutput {
return v.value
}
func (v *NullableTagGroupOrOutput) Set(val *TagGroupOrOutput) {
v.value = val
v.isSet = true
}
func (v NullableTagGroupOrOutput) IsSet() bool {
return v.isSet
}
func (v *NullableTagGroupOrOutput) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTagGroupOrOutput(val *TagGroupOrOutput) *NullableTagGroupOrOutput {
return &NullableTagGroupOrOutput{value: val, isSet: true}
}
func (v NullableTagGroupOrOutput) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTagGroupOrOutput) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -23,7 +23,7 @@ type UpdateMentalModelRequest struct {
SourceQuery NullableString `json:"source_query,omitempty"`
MaxTokens NullableInt32 `json:"max_tokens,omitempty"`
Tags []string `json:"tags,omitempty"`
Trigger NullableMentalModelTrigger `json:"trigger,omitempty"`
Trigger NullableMentalModelTriggerInput `json:"trigger,omitempty"`
}
// NewUpdateMentalModelRequest instantiates a new UpdateMentalModelRequest object
@ -203,9 +203,9 @@ func (o *UpdateMentalModelRequest) SetTags(v []string) {
}
// GetTrigger returns the Trigger field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UpdateMentalModelRequest) GetTrigger() MentalModelTrigger {
func (o *UpdateMentalModelRequest) GetTrigger() MentalModelTriggerInput {
if o == nil || IsNil(o.Trigger.Get()) {
var ret MentalModelTrigger
var ret MentalModelTriggerInput
return ret
}
return *o.Trigger.Get()
@ -214,7 +214,7 @@ func (o *UpdateMentalModelRequest) GetTrigger() MentalModelTrigger {
// GetTriggerOk returns a tuple with the Trigger field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UpdateMentalModelRequest) GetTriggerOk() (*MentalModelTrigger, bool) {
func (o *UpdateMentalModelRequest) GetTriggerOk() (*MentalModelTriggerInput, bool) {
if o == nil {
return nil, false
}
@ -230,8 +230,8 @@ func (o *UpdateMentalModelRequest) HasTrigger() bool {
return false
}
// SetTrigger gets a reference to the given NullableMentalModelTrigger and assigns it to the Trigger field.
func (o *UpdateMentalModelRequest) SetTrigger(v MentalModelTrigger) {
// SetTrigger gets a reference to the given NullableMentalModelTriggerInput and assigns it to the Trigger field.
func (o *UpdateMentalModelRequest) SetTrigger(v MentalModelTriggerInput) {
o.Trigger.Set(&v)
}
// SetTriggerNil sets the value for Trigger to be an explicit nil

View file

@ -66,14 +66,17 @@ hindsight_client_api/models/list_tags_response.py
hindsight_client_api/models/memory_item.py
hindsight_client_api/models/mental_model_list_response.py
hindsight_client_api/models/mental_model_response.py
hindsight_client_api/models/mental_model_trigger.py
hindsight_client_api/models/mental_model_trigger_input.py
hindsight_client_api/models/mental_model_trigger_input_tag_groups_inner.py
hindsight_client_api/models/mental_model_trigger_output.py
hindsight_client_api/models/mental_model_trigger_output_tag_groups_inner.py
hindsight_client_api/models/model_not.py
hindsight_client_api/models/not1.py
hindsight_client_api/models/observation_scopes.py
hindsight_client_api/models/operation_response.py
hindsight_client_api/models/operation_status_response.py
hindsight_client_api/models/operations_list_response.py
hindsight_client_api/models/recall_request.py
hindsight_client_api/models/recall_request_tag_groups_inner.py
hindsight_client_api/models/recall_response.py
hindsight_client_api/models/recall_result.py
hindsight_client_api/models/recover_consolidation_response.py
@ -91,10 +94,13 @@ hindsight_client_api/models/retain_request.py
hindsight_client_api/models/retain_response.py
hindsight_client_api/models/retry_operation_response.py
hindsight_client_api/models/source_facts_include_options.py
hindsight_client_api/models/tag_group_and.py
hindsight_client_api/models/tag_group_and_input.py
hindsight_client_api/models/tag_group_and_output.py
hindsight_client_api/models/tag_group_leaf.py
hindsight_client_api/models/tag_group_not.py
hindsight_client_api/models/tag_group_or.py
hindsight_client_api/models/tag_group_not_input.py
hindsight_client_api/models/tag_group_not_output.py
hindsight_client_api/models/tag_group_or_input.py
hindsight_client_api/models/tag_group_or_output.py
hindsight_client_api/models/tag_item.py
hindsight_client_api/models/timestamp.py
hindsight_client_api/models/token_usage.py

View file

@ -960,11 +960,11 @@ class Hindsight:
Returns:
CreateMentalModelResponse with operation_id
"""
from hindsight_client_api.models import create_mental_model_request, mental_model_trigger
from hindsight_client_api.models import create_mental_model_request, mental_model_trigger_input
trigger_obj = None
if trigger:
trigger_obj = mental_model_trigger.MentalModelTrigger(**trigger)
trigger_obj = mental_model_trigger_input.MentalModelTriggerInput(**trigger)
request_obj = create_mental_model_request.CreateMentalModelRequest(
id=id,
@ -1041,11 +1041,11 @@ class Hindsight:
Returns:
MentalModelResponse
"""
from hindsight_client_api.models import mental_model_trigger, update_mental_model_request
from hindsight_client_api.models import mental_model_trigger_input, update_mental_model_request
trigger_obj = None
if trigger:
trigger_obj = mental_model_trigger.MentalModelTrigger(**trigger)
trigger_obj = mental_model_trigger_input.MentalModelTriggerInput(**trigger)
request_obj = update_mental_model_request.UpdateMentalModelRequest(
name=name,

View file

@ -91,14 +91,17 @@ from hindsight_client_api.models.list_tags_response import ListTagsResponse
from hindsight_client_api.models.memory_item import MemoryItem
from hindsight_client_api.models.mental_model_list_response import MentalModelListResponse
from hindsight_client_api.models.mental_model_response import MentalModelResponse
from hindsight_client_api.models.mental_model_trigger import MentalModelTrigger
from hindsight_client_api.models.mental_model_trigger_input import MentalModelTriggerInput
from hindsight_client_api.models.mental_model_trigger_input_tag_groups_inner import MentalModelTriggerInputTagGroupsInner
from hindsight_client_api.models.mental_model_trigger_output import MentalModelTriggerOutput
from hindsight_client_api.models.mental_model_trigger_output_tag_groups_inner import MentalModelTriggerOutputTagGroupsInner
from hindsight_client_api.models.model_not import ModelNot
from hindsight_client_api.models.not1 import Not1
from hindsight_client_api.models.observation_scopes import ObservationScopes
from hindsight_client_api.models.operation_response import OperationResponse
from hindsight_client_api.models.operation_status_response import OperationStatusResponse
from hindsight_client_api.models.operations_list_response import OperationsListResponse
from hindsight_client_api.models.recall_request import RecallRequest
from hindsight_client_api.models.recall_request_tag_groups_inner import RecallRequestTagGroupsInner
from hindsight_client_api.models.recall_response import RecallResponse
from hindsight_client_api.models.recall_result import RecallResult
from hindsight_client_api.models.recover_consolidation_response import RecoverConsolidationResponse
@ -116,10 +119,13 @@ from hindsight_client_api.models.retain_request import RetainRequest
from hindsight_client_api.models.retain_response import RetainResponse
from hindsight_client_api.models.retry_operation_response import RetryOperationResponse
from hindsight_client_api.models.source_facts_include_options import SourceFactsIncludeOptions
from hindsight_client_api.models.tag_group_and import TagGroupAnd
from hindsight_client_api.models.tag_group_and_input import TagGroupAndInput
from hindsight_client_api.models.tag_group_and_output import TagGroupAndOutput
from hindsight_client_api.models.tag_group_leaf import TagGroupLeaf
from hindsight_client_api.models.tag_group_not import TagGroupNot
from hindsight_client_api.models.tag_group_or import TagGroupOr
from hindsight_client_api.models.tag_group_not_input import TagGroupNotInput
from hindsight_client_api.models.tag_group_not_output import TagGroupNotOutput
from hindsight_client_api.models.tag_group_or_input import TagGroupOrInput
from hindsight_client_api.models.tag_group_or_output import TagGroupOrOutput
from hindsight_client_api.models.tag_item import TagItem
from hindsight_client_api.models.timestamp import Timestamp
from hindsight_client_api.models.token_usage import TokenUsage

View file

@ -64,14 +64,17 @@ from hindsight_client_api.models.list_tags_response import ListTagsResponse
from hindsight_client_api.models.memory_item import MemoryItem
from hindsight_client_api.models.mental_model_list_response import MentalModelListResponse
from hindsight_client_api.models.mental_model_response import MentalModelResponse
from hindsight_client_api.models.mental_model_trigger import MentalModelTrigger
from hindsight_client_api.models.mental_model_trigger_input import MentalModelTriggerInput
from hindsight_client_api.models.mental_model_trigger_input_tag_groups_inner import MentalModelTriggerInputTagGroupsInner
from hindsight_client_api.models.mental_model_trigger_output import MentalModelTriggerOutput
from hindsight_client_api.models.mental_model_trigger_output_tag_groups_inner import MentalModelTriggerOutputTagGroupsInner
from hindsight_client_api.models.model_not import ModelNot
from hindsight_client_api.models.not1 import Not1
from hindsight_client_api.models.observation_scopes import ObservationScopes
from hindsight_client_api.models.operation_response import OperationResponse
from hindsight_client_api.models.operation_status_response import OperationStatusResponse
from hindsight_client_api.models.operations_list_response import OperationsListResponse
from hindsight_client_api.models.recall_request import RecallRequest
from hindsight_client_api.models.recall_request_tag_groups_inner import RecallRequestTagGroupsInner
from hindsight_client_api.models.recall_response import RecallResponse
from hindsight_client_api.models.recall_result import RecallResult
from hindsight_client_api.models.recover_consolidation_response import RecoverConsolidationResponse
@ -89,10 +92,13 @@ from hindsight_client_api.models.retain_request import RetainRequest
from hindsight_client_api.models.retain_response import RetainResponse
from hindsight_client_api.models.retry_operation_response import RetryOperationResponse
from hindsight_client_api.models.source_facts_include_options import SourceFactsIncludeOptions
from hindsight_client_api.models.tag_group_and import TagGroupAnd
from hindsight_client_api.models.tag_group_and_input import TagGroupAndInput
from hindsight_client_api.models.tag_group_and_output import TagGroupAndOutput
from hindsight_client_api.models.tag_group_leaf import TagGroupLeaf
from hindsight_client_api.models.tag_group_not import TagGroupNot
from hindsight_client_api.models.tag_group_or import TagGroupOr
from hindsight_client_api.models.tag_group_not_input import TagGroupNotInput
from hindsight_client_api.models.tag_group_not_output import TagGroupNotOutput
from hindsight_client_api.models.tag_group_or_input import TagGroupOrInput
from hindsight_client_api.models.tag_group_or_output import TagGroupOrOutput
from hindsight_client_api.models.tag_item import TagItem
from hindsight_client_api.models.timestamp import Timestamp
from hindsight_client_api.models.token_usage import TokenUsage

View file

@ -20,7 +20,7 @@ import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from hindsight_client_api.models.mental_model_trigger import MentalModelTrigger
from hindsight_client_api.models.mental_model_trigger_input import MentalModelTriggerInput
from typing import Optional, Set
from typing_extensions import Self
@ -33,7 +33,7 @@ class CreateMentalModelRequest(BaseModel):
source_query: StrictStr = Field(description="The query to run to generate content")
tags: Optional[List[StrictStr]] = Field(default=None, description="Tags for scoped visibility")
max_tokens: Optional[Annotated[int, Field(le=8192, strict=True, ge=256)]] = Field(default=2048, description="Maximum tokens for generated content")
trigger: Optional[MentalModelTrigger] = Field(default=None, description="Trigger settings")
trigger: Optional[MentalModelTriggerInput] = Field(default=None, description="Trigger settings")
__properties: ClassVar[List[str]] = ["id", "name", "source_query", "tags", "max_tokens", "trigger"]
model_config = ConfigDict(
@ -100,7 +100,7 @@ class CreateMentalModelRequest(BaseModel):
"source_query": obj.get("source_query"),
"tags": obj.get("tags"),
"max_tokens": obj.get("max_tokens") if obj.get("max_tokens") is not None else 2048,
"trigger": MentalModelTrigger.from_dict(obj["trigger"]) if obj.get("trigger") is not None else None
"trigger": MentalModelTriggerInput.from_dict(obj["trigger"]) if obj.get("trigger") is not None else None
})
return _obj

View file

@ -19,7 +19,7 @@ import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from hindsight_client_api.models.mental_model_trigger import MentalModelTrigger
from hindsight_client_api.models.mental_model_trigger_output import MentalModelTriggerOutput
from typing import Optional, Set
from typing_extensions import Self
@ -34,7 +34,7 @@ class MentalModelResponse(BaseModel):
content: StrictStr = Field(description="The mental model content as well-formatted markdown (auto-generated from reflect endpoint)")
tags: Optional[List[StrictStr]] = None
max_tokens: Optional[StrictInt] = 2048
trigger: Optional[MentalModelTrigger] = None
trigger: Optional[MentalModelTriggerOutput] = None
last_refreshed_at: Optional[StrictStr] = None
created_at: Optional[StrictStr] = None
reflect_response: Optional[Dict[str, Any]] = None
@ -116,7 +116,7 @@ class MentalModelResponse(BaseModel):
"content": obj.get("content"),
"tags": obj.get("tags"),
"max_tokens": obj.get("max_tokens") if obj.get("max_tokens") is not None else 2048,
"trigger": MentalModelTrigger.from_dict(obj["trigger"]) if obj.get("trigger") is not None else None,
"trigger": MentalModelTriggerOutput.from_dict(obj["trigger"]) if obj.get("trigger") is not None else None,
"last_refreshed_at": obj.get("last_refreshed_at"),
"created_at": obj.get("created_at"),
"reflect_response": obj.get("reflect_response")

View file

@ -19,10 +19,11 @@ import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from hindsight_client_api.models.mental_model_trigger_input_tag_groups_inner import MentalModelTriggerInputTagGroupsInner
from typing import Optional, Set
from typing_extensions import Self
class MentalModelTrigger(BaseModel):
class MentalModelTriggerInput(BaseModel):
"""
Trigger settings for a mental model.
""" # noqa: E501
@ -30,7 +31,9 @@ class MentalModelTrigger(BaseModel):
fact_types: Optional[List[StrictStr]] = None
exclude_mental_models: Optional[StrictBool] = Field(default=False, description="If true, exclude all mental models from the reflect loop (skip search_mental_models tool).")
exclude_mental_model_ids: Optional[List[StrictStr]] = None
__properties: ClassVar[List[str]] = ["refresh_after_consolidation", "fact_types", "exclude_mental_models", "exclude_mental_model_ids"]
tags_match: Optional[StrictStr] = None
tag_groups: Optional[List[MentalModelTriggerInputTagGroupsInner]] = None
__properties: ClassVar[List[str]] = ["refresh_after_consolidation", "fact_types", "exclude_mental_models", "exclude_mental_model_ids", "tags_match", "tag_groups"]
@field_validator('fact_types')
def fact_types_validate_enum(cls, value):
@ -43,6 +46,16 @@ class MentalModelTrigger(BaseModel):
raise ValueError("each list item must be one of ('world', 'experience', 'observation')")
return value
@field_validator('tags_match')
def tags_match_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
if value not in set(['any', 'all', 'any_strict', 'all_strict']):
raise ValueError("must be one of enum values ('any', 'all', 'any_strict', 'all_strict')")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
@ -61,7 +74,7 @@ class MentalModelTrigger(BaseModel):
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of MentalModelTrigger from a JSON string"""
"""Create an instance of MentalModelTriggerInput from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
@ -82,6 +95,13 @@ class MentalModelTrigger(BaseModel):
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in tag_groups (list)
_items = []
if self.tag_groups:
for _item_tag_groups in self.tag_groups:
if _item_tag_groups:
_items.append(_item_tag_groups.to_dict())
_dict['tag_groups'] = _items
# set to None if fact_types (nullable) is None
# and model_fields_set contains the field
if self.fact_types is None and "fact_types" in self.model_fields_set:
@ -92,11 +112,21 @@ class MentalModelTrigger(BaseModel):
if self.exclude_mental_model_ids is None and "exclude_mental_model_ids" in self.model_fields_set:
_dict['exclude_mental_model_ids'] = None
# set to None if tags_match (nullable) is None
# and model_fields_set contains the field
if self.tags_match is None and "tags_match" in self.model_fields_set:
_dict['tags_match'] = None
# set to None if tag_groups (nullable) is None
# and model_fields_set contains the field
if self.tag_groups is None and "tag_groups" in self.model_fields_set:
_dict['tag_groups'] = None
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of MentalModelTrigger from a dict"""
"""Create an instance of MentalModelTriggerInput from a dict"""
if obj is None:
return None
@ -107,7 +137,9 @@ class MentalModelTrigger(BaseModel):
"refresh_after_consolidation": obj.get("refresh_after_consolidation") if obj.get("refresh_after_consolidation") is not None else False,
"fact_types": obj.get("fact_types"),
"exclude_mental_models": obj.get("exclude_mental_models") if obj.get("exclude_mental_models") is not None else False,
"exclude_mental_model_ids": obj.get("exclude_mental_model_ids")
"exclude_mental_model_ids": obj.get("exclude_mental_model_ids"),
"tags_match": obj.get("tags_match"),
"tag_groups": [MentalModelTriggerInputTagGroupsInner.from_dict(_item) for _item in obj["tag_groups"]] if obj.get("tag_groups") is not None else None
})
return _obj

View file

@ -0,0 +1,166 @@
# coding: utf-8
"""
Hindsight HTTP API
HTTP API for Hindsight
The version of the OpenAPI document: 0.4.21
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
from inspect import getfullargspec
import json
import pprint
import re # noqa: F401
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
from typing import Optional
from hindsight_client_api.models.tag_group_leaf import TagGroupLeaf
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
from typing_extensions import Literal, Self
from pydantic import Field
MENTALMODELTRIGGERINPUTTAGGROUPSINNER_ANY_OF_SCHEMAS = ["TagGroupAndInput", "TagGroupLeaf", "TagGroupNotInput", "TagGroupOrInput"]
class MentalModelTriggerInputTagGroupsInner(BaseModel):
"""
MentalModelTriggerInputTagGroupsInner
"""
# data type: TagGroupLeaf
anyof_schema_1_validator: Optional[TagGroupLeaf] = None
# data type: TagGroupAndInput
anyof_schema_2_validator: Optional[TagGroupAndInput] = None
# data type: TagGroupOrInput
anyof_schema_3_validator: Optional[TagGroupOrInput] = None
# data type: TagGroupNotInput
anyof_schema_4_validator: Optional[TagGroupNotInput] = None
if TYPE_CHECKING:
actual_instance: Optional[Union[TagGroupAndInput, TagGroupLeaf, TagGroupNotInput, TagGroupOrInput]] = None
else:
actual_instance: Any = None
any_of_schemas: Set[str] = { "TagGroupAndInput", "TagGroupLeaf", "TagGroupNotInput", "TagGroupOrInput" }
model_config = {
"validate_assignment": True,
"protected_namespaces": (),
}
def __init__(self, *args, **kwargs) -> None:
if args:
if len(args) > 1:
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
if kwargs:
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
super().__init__(actual_instance=args[0])
else:
super().__init__(**kwargs)
@field_validator('actual_instance')
def actual_instance_must_validate_anyof(cls, v):
instance = MentalModelTriggerInputTagGroupsInner.model_construct()
error_messages = []
# validate data type: TagGroupLeaf
if not isinstance(v, TagGroupLeaf):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupLeaf`")
else:
return v
# validate data type: TagGroupAndInput
if not isinstance(v, TagGroupAndInput):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupAndInput`")
else:
return v
# validate data type: TagGroupOrInput
if not isinstance(v, TagGroupOrInput):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupOrInput`")
else:
return v
# validate data type: TagGroupNotInput
if not isinstance(v, TagGroupNotInput):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupNotInput`")
else:
return v
if error_messages:
# no match
raise ValueError("No match found when setting the actual_instance in MentalModelTriggerInputTagGroupsInner with anyOf schemas: TagGroupAndInput, TagGroupLeaf, TagGroupNotInput, TagGroupOrInput. Details: " + ", ".join(error_messages))
else:
return v
@classmethod
def from_dict(cls, obj: Dict[str, Any]) -> Self:
return cls.from_json(json.dumps(obj))
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Returns the object represented by the json string"""
instance = cls.model_construct()
error_messages = []
# anyof_schema_1_validator: Optional[TagGroupLeaf] = None
try:
instance.actual_instance = TagGroupLeaf.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# anyof_schema_2_validator: Optional[TagGroupAndInput] = None
try:
instance.actual_instance = TagGroupAndInput.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# anyof_schema_3_validator: Optional[TagGroupOrInput] = None
try:
instance.actual_instance = TagGroupOrInput.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# anyof_schema_4_validator: Optional[TagGroupNotInput] = None
try:
instance.actual_instance = TagGroupNotInput.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
if error_messages:
# no match
raise ValueError("No match found when deserializing the JSON string into MentalModelTriggerInputTagGroupsInner with anyOf schemas: TagGroupAndInput, TagGroupLeaf, TagGroupNotInput, TagGroupOrInput. Details: " + ", ".join(error_messages))
else:
return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
return self.actual_instance.to_json()
else:
return json.dumps(self.actual_instance)
def to_dict(self) -> Optional[Union[Dict[str, Any], TagGroupAndInput, TagGroupLeaf, TagGroupNotInput, TagGroupOrInput]]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
return self.actual_instance.to_dict()
else:
return self.actual_instance
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())
from hindsight_client_api.models.tag_group_and_input import TagGroupAndInput
from hindsight_client_api.models.tag_group_not_input import TagGroupNotInput
from hindsight_client_api.models.tag_group_or_input import TagGroupOrInput
# TODO: Rewrite to not use raise_errors
MentalModelTriggerInputTagGroupsInner.model_rebuild(raise_errors=False)

View file

@ -0,0 +1,146 @@
# coding: utf-8
"""
Hindsight HTTP API
HTTP API for Hindsight
The version of the OpenAPI document: 0.4.21
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from hindsight_client_api.models.mental_model_trigger_output_tag_groups_inner import MentalModelTriggerOutputTagGroupsInner
from typing import Optional, Set
from typing_extensions import Self
class MentalModelTriggerOutput(BaseModel):
"""
Trigger settings for a mental model.
""" # noqa: E501
refresh_after_consolidation: Optional[StrictBool] = Field(default=False, description="If true, refresh this mental model after observations consolidation (real-time mode)")
fact_types: Optional[List[StrictStr]] = None
exclude_mental_models: Optional[StrictBool] = Field(default=False, description="If true, exclude all mental models from the reflect loop (skip search_mental_models tool).")
exclude_mental_model_ids: Optional[List[StrictStr]] = None
tags_match: Optional[StrictStr] = None
tag_groups: Optional[List[MentalModelTriggerOutputTagGroupsInner]] = None
__properties: ClassVar[List[str]] = ["refresh_after_consolidation", "fact_types", "exclude_mental_models", "exclude_mental_model_ids", "tags_match", "tag_groups"]
@field_validator('fact_types')
def fact_types_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
for i in value:
if i not in set(['world', 'experience', 'observation']):
raise ValueError("each list item must be one of ('world', 'experience', 'observation')")
return value
@field_validator('tags_match')
def tags_match_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
if value not in set(['any', 'all', 'any_strict', 'all_strict']):
raise ValueError("must be one of enum values ('any', 'all', 'any_strict', 'all_strict')")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of MentalModelTriggerOutput from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in tag_groups (list)
_items = []
if self.tag_groups:
for _item_tag_groups in self.tag_groups:
if _item_tag_groups:
_items.append(_item_tag_groups.to_dict())
_dict['tag_groups'] = _items
# set to None if fact_types (nullable) is None
# and model_fields_set contains the field
if self.fact_types is None and "fact_types" in self.model_fields_set:
_dict['fact_types'] = None
# set to None if exclude_mental_model_ids (nullable) is None
# and model_fields_set contains the field
if self.exclude_mental_model_ids is None and "exclude_mental_model_ids" in self.model_fields_set:
_dict['exclude_mental_model_ids'] = None
# set to None if tags_match (nullable) is None
# and model_fields_set contains the field
if self.tags_match is None and "tags_match" in self.model_fields_set:
_dict['tags_match'] = None
# set to None if tag_groups (nullable) is None
# and model_fields_set contains the field
if self.tag_groups is None and "tag_groups" in self.model_fields_set:
_dict['tag_groups'] = None
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of MentalModelTriggerOutput from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"refresh_after_consolidation": obj.get("refresh_after_consolidation") if obj.get("refresh_after_consolidation") is not None else False,
"fact_types": obj.get("fact_types"),
"exclude_mental_models": obj.get("exclude_mental_models") if obj.get("exclude_mental_models") is not None else False,
"exclude_mental_model_ids": obj.get("exclude_mental_model_ids"),
"tags_match": obj.get("tags_match"),
"tag_groups": [MentalModelTriggerOutputTagGroupsInner.from_dict(_item) for _item in obj["tag_groups"]] if obj.get("tag_groups") is not None else None
})
return _obj

View file

@ -0,0 +1,166 @@
# coding: utf-8
"""
Hindsight HTTP API
HTTP API for Hindsight
The version of the OpenAPI document: 0.4.21
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
from inspect import getfullargspec
import json
import pprint
import re # noqa: F401
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
from typing import Optional
from hindsight_client_api.models.tag_group_leaf import TagGroupLeaf
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
from typing_extensions import Literal, Self
from pydantic import Field
MENTALMODELTRIGGEROUTPUTTAGGROUPSINNER_ANY_OF_SCHEMAS = ["TagGroupAndOutput", "TagGroupLeaf", "TagGroupNotOutput", "TagGroupOrOutput"]
class MentalModelTriggerOutputTagGroupsInner(BaseModel):
"""
MentalModelTriggerOutputTagGroupsInner
"""
# data type: TagGroupLeaf
anyof_schema_1_validator: Optional[TagGroupLeaf] = None
# data type: TagGroupAndOutput
anyof_schema_2_validator: Optional[TagGroupAndOutput] = None
# data type: TagGroupOrOutput
anyof_schema_3_validator: Optional[TagGroupOrOutput] = None
# data type: TagGroupNotOutput
anyof_schema_4_validator: Optional[TagGroupNotOutput] = None
if TYPE_CHECKING:
actual_instance: Optional[Union[TagGroupAndOutput, TagGroupLeaf, TagGroupNotOutput, TagGroupOrOutput]] = None
else:
actual_instance: Any = None
any_of_schemas: Set[str] = { "TagGroupAndOutput", "TagGroupLeaf", "TagGroupNotOutput", "TagGroupOrOutput" }
model_config = {
"validate_assignment": True,
"protected_namespaces": (),
}
def __init__(self, *args, **kwargs) -> None:
if args:
if len(args) > 1:
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
if kwargs:
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
super().__init__(actual_instance=args[0])
else:
super().__init__(**kwargs)
@field_validator('actual_instance')
def actual_instance_must_validate_anyof(cls, v):
instance = MentalModelTriggerOutputTagGroupsInner.model_construct()
error_messages = []
# validate data type: TagGroupLeaf
if not isinstance(v, TagGroupLeaf):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupLeaf`")
else:
return v
# validate data type: TagGroupAndOutput
if not isinstance(v, TagGroupAndOutput):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupAndOutput`")
else:
return v
# validate data type: TagGroupOrOutput
if not isinstance(v, TagGroupOrOutput):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupOrOutput`")
else:
return v
# validate data type: TagGroupNotOutput
if not isinstance(v, TagGroupNotOutput):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupNotOutput`")
else:
return v
if error_messages:
# no match
raise ValueError("No match found when setting the actual_instance in MentalModelTriggerOutputTagGroupsInner with anyOf schemas: TagGroupAndOutput, TagGroupLeaf, TagGroupNotOutput, TagGroupOrOutput. Details: " + ", ".join(error_messages))
else:
return v
@classmethod
def from_dict(cls, obj: Dict[str, Any]) -> Self:
return cls.from_json(json.dumps(obj))
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Returns the object represented by the json string"""
instance = cls.model_construct()
error_messages = []
# anyof_schema_1_validator: Optional[TagGroupLeaf] = None
try:
instance.actual_instance = TagGroupLeaf.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# anyof_schema_2_validator: Optional[TagGroupAndOutput] = None
try:
instance.actual_instance = TagGroupAndOutput.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# anyof_schema_3_validator: Optional[TagGroupOrOutput] = None
try:
instance.actual_instance = TagGroupOrOutput.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# anyof_schema_4_validator: Optional[TagGroupNotOutput] = None
try:
instance.actual_instance = TagGroupNotOutput.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
if error_messages:
# no match
raise ValueError("No match found when deserializing the JSON string into MentalModelTriggerOutputTagGroupsInner with anyOf schemas: TagGroupAndOutput, TagGroupLeaf, TagGroupNotOutput, TagGroupOrOutput. Details: " + ", ".join(error_messages))
else:
return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
return self.actual_instance.to_json()
else:
return json.dumps(self.actual_instance)
def to_dict(self) -> Optional[Union[Dict[str, Any], TagGroupAndOutput, TagGroupLeaf, TagGroupNotOutput, TagGroupOrOutput]]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
return self.actual_instance.to_dict()
else:
return self.actual_instance
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())
from hindsight_client_api.models.tag_group_and_output import TagGroupAndOutput
from hindsight_client_api.models.tag_group_not_output import TagGroupNotOutput
from hindsight_client_api.models.tag_group_or_output import TagGroupOrOutput
# TODO: Rewrite to not use raise_errors
MentalModelTriggerOutputTagGroupsInner.model_rebuild(raise_errors=False)

View file

@ -24,7 +24,7 @@ from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
from typing_extensions import Literal, Self
from pydantic import Field
MODELNOT_ANY_OF_SCHEMAS = ["TagGroupAnd", "TagGroupLeaf", "TagGroupNot", "TagGroupOr"]
MODELNOT_ANY_OF_SCHEMAS = ["TagGroupAndInput", "TagGroupLeaf", "TagGroupNotInput", "TagGroupOrInput"]
class ModelNot(BaseModel):
"""
@ -33,17 +33,17 @@ class ModelNot(BaseModel):
# data type: TagGroupLeaf
anyof_schema_1_validator: Optional[TagGroupLeaf] = None
# data type: TagGroupAnd
anyof_schema_2_validator: Optional[TagGroupAnd] = None
# data type: TagGroupOr
anyof_schema_3_validator: Optional[TagGroupOr] = None
# data type: TagGroupNot
anyof_schema_4_validator: Optional[TagGroupNot] = None
# data type: TagGroupAndInput
anyof_schema_2_validator: Optional[TagGroupAndInput] = None
# data type: TagGroupOrInput
anyof_schema_3_validator: Optional[TagGroupOrInput] = None
# data type: TagGroupNotInput
anyof_schema_4_validator: Optional[TagGroupNotInput] = None
if TYPE_CHECKING:
actual_instance: Optional[Union[TagGroupAnd, TagGroupLeaf, TagGroupNot, TagGroupOr]] = None
actual_instance: Optional[Union[TagGroupAndInput, TagGroupLeaf, TagGroupNotInput, TagGroupOrInput]] = None
else:
actual_instance: Any = None
any_of_schemas: Set[str] = { "TagGroupAnd", "TagGroupLeaf", "TagGroupNot", "TagGroupOr" }
any_of_schemas: Set[str] = { "TagGroupAndInput", "TagGroupLeaf", "TagGroupNotInput", "TagGroupOrInput" }
model_config = {
"validate_assignment": True,
@ -70,27 +70,27 @@ class ModelNot(BaseModel):
else:
return v
# validate data type: TagGroupAnd
if not isinstance(v, TagGroupAnd):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupAnd`")
# validate data type: TagGroupAndInput
if not isinstance(v, TagGroupAndInput):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupAndInput`")
else:
return v
# validate data type: TagGroupOr
if not isinstance(v, TagGroupOr):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupOr`")
# validate data type: TagGroupOrInput
if not isinstance(v, TagGroupOrInput):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupOrInput`")
else:
return v
# validate data type: TagGroupNot
if not isinstance(v, TagGroupNot):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupNot`")
# validate data type: TagGroupNotInput
if not isinstance(v, TagGroupNotInput):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupNotInput`")
else:
return v
if error_messages:
# no match
raise ValueError("No match found when setting the actual_instance in ModelNot with anyOf schemas: TagGroupAnd, TagGroupLeaf, TagGroupNot, TagGroupOr. Details: " + ", ".join(error_messages))
raise ValueError("No match found when setting the actual_instance in ModelNot with anyOf schemas: TagGroupAndInput, TagGroupLeaf, TagGroupNotInput, TagGroupOrInput. Details: " + ", ".join(error_messages))
else:
return v
@ -109,28 +109,28 @@ class ModelNot(BaseModel):
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# anyof_schema_2_validator: Optional[TagGroupAnd] = None
# anyof_schema_2_validator: Optional[TagGroupAndInput] = None
try:
instance.actual_instance = TagGroupAnd.from_json(json_str)
instance.actual_instance = TagGroupAndInput.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# anyof_schema_3_validator: Optional[TagGroupOr] = None
# anyof_schema_3_validator: Optional[TagGroupOrInput] = None
try:
instance.actual_instance = TagGroupOr.from_json(json_str)
instance.actual_instance = TagGroupOrInput.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# anyof_schema_4_validator: Optional[TagGroupNot] = None
# anyof_schema_4_validator: Optional[TagGroupNotInput] = None
try:
instance.actual_instance = TagGroupNot.from_json(json_str)
instance.actual_instance = TagGroupNotInput.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
if error_messages:
# no match
raise ValueError("No match found when deserializing the JSON string into ModelNot with anyOf schemas: TagGroupAnd, TagGroupLeaf, TagGroupNot, TagGroupOr. Details: " + ", ".join(error_messages))
raise ValueError("No match found when deserializing the JSON string into ModelNot with anyOf schemas: TagGroupAndInput, TagGroupLeaf, TagGroupNotInput, TagGroupOrInput. Details: " + ", ".join(error_messages))
else:
return instance
@ -144,7 +144,7 @@ class ModelNot(BaseModel):
else:
return json.dumps(self.actual_instance)
def to_dict(self) -> Optional[Union[Dict[str, Any], TagGroupAnd, TagGroupLeaf, TagGroupNot, TagGroupOr]]:
def to_dict(self) -> Optional[Union[Dict[str, Any], TagGroupAndInput, TagGroupLeaf, TagGroupNotInput, TagGroupOrInput]]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
@ -158,9 +158,9 @@ class ModelNot(BaseModel):
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())
from hindsight_client_api.models.tag_group_and import TagGroupAnd
from hindsight_client_api.models.tag_group_not import TagGroupNot
from hindsight_client_api.models.tag_group_or import TagGroupOr
from hindsight_client_api.models.tag_group_and_input import TagGroupAndInput
from hindsight_client_api.models.tag_group_not_input import TagGroupNotInput
from hindsight_client_api.models.tag_group_or_input import TagGroupOrInput
# TODO: Rewrite to not use raise_errors
ModelNot.model_rebuild(raise_errors=False)

View file

@ -24,26 +24,26 @@ from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
from typing_extensions import Literal, Self
from pydantic import Field
RECALLREQUESTTAGGROUPSINNER_ANY_OF_SCHEMAS = ["TagGroupAnd", "TagGroupLeaf", "TagGroupNot", "TagGroupOr"]
NOT1_ANY_OF_SCHEMAS = ["TagGroupAndOutput", "TagGroupLeaf", "TagGroupNotOutput", "TagGroupOrOutput"]
class RecallRequestTagGroupsInner(BaseModel):
class Not1(BaseModel):
"""
RecallRequestTagGroupsInner
Not1
"""
# data type: TagGroupLeaf
anyof_schema_1_validator: Optional[TagGroupLeaf] = None
# data type: TagGroupAnd
anyof_schema_2_validator: Optional[TagGroupAnd] = None
# data type: TagGroupOr
anyof_schema_3_validator: Optional[TagGroupOr] = None
# data type: TagGroupNot
anyof_schema_4_validator: Optional[TagGroupNot] = None
# data type: TagGroupAndOutput
anyof_schema_2_validator: Optional[TagGroupAndOutput] = None
# data type: TagGroupOrOutput
anyof_schema_3_validator: Optional[TagGroupOrOutput] = None
# data type: TagGroupNotOutput
anyof_schema_4_validator: Optional[TagGroupNotOutput] = None
if TYPE_CHECKING:
actual_instance: Optional[Union[TagGroupAnd, TagGroupLeaf, TagGroupNot, TagGroupOr]] = None
actual_instance: Optional[Union[TagGroupAndOutput, TagGroupLeaf, TagGroupNotOutput, TagGroupOrOutput]] = None
else:
actual_instance: Any = None
any_of_schemas: Set[str] = { "TagGroupAnd", "TagGroupLeaf", "TagGroupNot", "TagGroupOr" }
any_of_schemas: Set[str] = { "TagGroupAndOutput", "TagGroupLeaf", "TagGroupNotOutput", "TagGroupOrOutput" }
model_config = {
"validate_assignment": True,
@ -62,7 +62,7 @@ class RecallRequestTagGroupsInner(BaseModel):
@field_validator('actual_instance')
def actual_instance_must_validate_anyof(cls, v):
instance = RecallRequestTagGroupsInner.model_construct()
instance = Not1.model_construct()
error_messages = []
# validate data type: TagGroupLeaf
if not isinstance(v, TagGroupLeaf):
@ -70,27 +70,27 @@ class RecallRequestTagGroupsInner(BaseModel):
else:
return v
# validate data type: TagGroupAnd
if not isinstance(v, TagGroupAnd):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupAnd`")
# validate data type: TagGroupAndOutput
if not isinstance(v, TagGroupAndOutput):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupAndOutput`")
else:
return v
# validate data type: TagGroupOr
if not isinstance(v, TagGroupOr):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupOr`")
# validate data type: TagGroupOrOutput
if not isinstance(v, TagGroupOrOutput):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupOrOutput`")
else:
return v
# validate data type: TagGroupNot
if not isinstance(v, TagGroupNot):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupNot`")
# validate data type: TagGroupNotOutput
if not isinstance(v, TagGroupNotOutput):
error_messages.append(f"Error! Input type `{type(v)}` is not `TagGroupNotOutput`")
else:
return v
if error_messages:
# no match
raise ValueError("No match found when setting the actual_instance in RecallRequestTagGroupsInner with anyOf schemas: TagGroupAnd, TagGroupLeaf, TagGroupNot, TagGroupOr. Details: " + ", ".join(error_messages))
raise ValueError("No match found when setting the actual_instance in Not1 with anyOf schemas: TagGroupAndOutput, TagGroupLeaf, TagGroupNotOutput, TagGroupOrOutput. Details: " + ", ".join(error_messages))
else:
return v
@ -109,28 +109,28 @@ class RecallRequestTagGroupsInner(BaseModel):
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# anyof_schema_2_validator: Optional[TagGroupAnd] = None
# anyof_schema_2_validator: Optional[TagGroupAndOutput] = None
try:
instance.actual_instance = TagGroupAnd.from_json(json_str)
instance.actual_instance = TagGroupAndOutput.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# anyof_schema_3_validator: Optional[TagGroupOr] = None
# anyof_schema_3_validator: Optional[TagGroupOrOutput] = None
try:
instance.actual_instance = TagGroupOr.from_json(json_str)
instance.actual_instance = TagGroupOrOutput.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# anyof_schema_4_validator: Optional[TagGroupNot] = None
# anyof_schema_4_validator: Optional[TagGroupNotOutput] = None
try:
instance.actual_instance = TagGroupNot.from_json(json_str)
instance.actual_instance = TagGroupNotOutput.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
if error_messages:
# no match
raise ValueError("No match found when deserializing the JSON string into RecallRequestTagGroupsInner with anyOf schemas: TagGroupAnd, TagGroupLeaf, TagGroupNot, TagGroupOr. Details: " + ", ".join(error_messages))
raise ValueError("No match found when deserializing the JSON string into Not1 with anyOf schemas: TagGroupAndOutput, TagGroupLeaf, TagGroupNotOutput, TagGroupOrOutput. Details: " + ", ".join(error_messages))
else:
return instance
@ -144,7 +144,7 @@ class RecallRequestTagGroupsInner(BaseModel):
else:
return json.dumps(self.actual_instance)
def to_dict(self) -> Optional[Union[Dict[str, Any], TagGroupAnd, TagGroupLeaf, TagGroupNot, TagGroupOr]]:
def to_dict(self) -> Optional[Union[Dict[str, Any], TagGroupAndOutput, TagGroupLeaf, TagGroupNotOutput, TagGroupOrOutput]]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
@ -158,9 +158,9 @@ class RecallRequestTagGroupsInner(BaseModel):
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())
from hindsight_client_api.models.tag_group_and import TagGroupAnd
from hindsight_client_api.models.tag_group_not import TagGroupNot
from hindsight_client_api.models.tag_group_or import TagGroupOr
from hindsight_client_api.models.tag_group_and_output import TagGroupAndOutput
from hindsight_client_api.models.tag_group_not_output import TagGroupNotOutput
from hindsight_client_api.models.tag_group_or_output import TagGroupOrOutput
# TODO: Rewrite to not use raise_errors
RecallRequestTagGroupsInner.model_rebuild(raise_errors=False)
Not1.model_rebuild(raise_errors=False)

View file

@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, Strict
from typing import Any, ClassVar, Dict, List, Optional
from hindsight_client_api.models.budget import Budget
from hindsight_client_api.models.include_options import IncludeOptions
from hindsight_client_api.models.recall_request_tag_groups_inner import RecallRequestTagGroupsInner
from hindsight_client_api.models.mental_model_trigger_input_tag_groups_inner import MentalModelTriggerInputTagGroupsInner
from typing import Optional, Set
from typing_extensions import Self
@ -38,7 +38,7 @@ class RecallRequest(BaseModel):
include: Optional[IncludeOptions] = Field(default=None, description="Options for including additional data (entities are included by default)")
tags: Optional[List[StrictStr]] = None
tags_match: Optional[StrictStr] = Field(default='any', description="How to match tags: 'any' (OR, includes untagged), 'all' (AND, includes untagged), 'any_strict' (OR, excludes untagged), 'all_strict' (AND, excludes untagged).")
tag_groups: Optional[List[RecallRequestTagGroupsInner]] = None
tag_groups: Optional[List[MentalModelTriggerInputTagGroupsInner]] = None
__properties: ClassVar[List[str]] = ["query", "types", "budget", "max_tokens", "trace", "query_timestamp", "include", "tags", "tags_match", "tag_groups"]
@field_validator('tags_match')
@ -141,7 +141,7 @@ class RecallRequest(BaseModel):
"include": IncludeOptions.from_dict(obj["include"]) if obj.get("include") is not None else None,
"tags": obj.get("tags"),
"tags_match": obj.get("tags_match") if obj.get("tags_match") is not None else 'any',
"tag_groups": [RecallRequestTagGroupsInner.from_dict(_item) for _item in obj["tag_groups"]] if obj.get("tag_groups") is not None else None
"tag_groups": [MentalModelTriggerInputTagGroupsInner.from_dict(_item) for _item in obj["tag_groups"]] if obj.get("tag_groups") is not None else None
})
return _obj

View file

@ -20,7 +20,7 @@ import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from hindsight_client_api.models.budget import Budget
from hindsight_client_api.models.recall_request_tag_groups_inner import RecallRequestTagGroupsInner
from hindsight_client_api.models.mental_model_trigger_input_tag_groups_inner import MentalModelTriggerInputTagGroupsInner
from hindsight_client_api.models.reflect_include_options import ReflectIncludeOptions
from typing import Optional, Set
from typing_extensions import Self
@ -37,7 +37,7 @@ class ReflectRequest(BaseModel):
response_schema: Optional[Dict[str, Any]] = None
tags: Optional[List[StrictStr]] = None
tags_match: Optional[StrictStr] = Field(default='any', description="How to match tags: 'any' (OR, includes untagged), 'all' (AND, includes untagged), 'any_strict' (OR, excludes untagged), 'all_strict' (AND, excludes untagged).")
tag_groups: Optional[List[RecallRequestTagGroupsInner]] = None
tag_groups: Optional[List[MentalModelTriggerInputTagGroupsInner]] = None
fact_types: Optional[List[StrictStr]] = None
exclude_mental_models: Optional[StrictBool] = Field(default=False, description="If true, exclude all mental models from the reflect loop (skip search_mental_models tool).")
exclude_mental_model_ids: Optional[List[StrictStr]] = None
@ -163,7 +163,7 @@ class ReflectRequest(BaseModel):
"response_schema": obj.get("response_schema"),
"tags": obj.get("tags"),
"tags_match": obj.get("tags_match") if obj.get("tags_match") is not None else 'any',
"tag_groups": [RecallRequestTagGroupsInner.from_dict(_item) for _item in obj["tag_groups"]] if obj.get("tag_groups") is not None else None,
"tag_groups": [MentalModelTriggerInputTagGroupsInner.from_dict(_item) for _item in obj["tag_groups"]] if obj.get("tag_groups") is not None else None,
"fact_types": obj.get("fact_types"),
"exclude_mental_models": obj.get("exclude_mental_models") if obj.get("exclude_mental_models") is not None else False,
"exclude_mental_model_ids": obj.get("exclude_mental_model_ids")

View file

@ -22,11 +22,11 @@ from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
class TagGroupAnd(BaseModel):
class TagGroupAndInput(BaseModel):
"""
Compound AND group: all child filters must match.
""" # noqa: E501
var_and: List[RecallRequestTagGroupsInner] = Field(alias="and")
var_and: List[MentalModelTriggerInputTagGroupsInner] = Field(alias="and")
__properties: ClassVar[List[str]] = ["and"]
model_config = ConfigDict(
@ -47,7 +47,7 @@ class TagGroupAnd(BaseModel):
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of TagGroupAnd from a JSON string"""
"""Create an instance of TagGroupAndInput from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
@ -79,7 +79,7 @@ class TagGroupAnd(BaseModel):
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of TagGroupAnd from a dict"""
"""Create an instance of TagGroupAndInput from a dict"""
if obj is None:
return None
@ -87,11 +87,11 @@ class TagGroupAnd(BaseModel):
return cls.model_validate(obj)
_obj = cls.model_validate({
"and": [RecallRequestTagGroupsInner.from_dict(_item) for _item in obj["and"]] if obj.get("and") is not None else None
"and": [MentalModelTriggerInputTagGroupsInner.from_dict(_item) for _item in obj["and"]] if obj.get("and") is not None else None
})
return _obj
from hindsight_client_api.models.recall_request_tag_groups_inner import RecallRequestTagGroupsInner
from hindsight_client_api.models.mental_model_trigger_input_tag_groups_inner import MentalModelTriggerInputTagGroupsInner
# TODO: Rewrite to not use raise_errors
TagGroupAnd.model_rebuild(raise_errors=False)
TagGroupAndInput.model_rebuild(raise_errors=False)

View file

@ -0,0 +1,97 @@
# coding: utf-8
"""
Hindsight HTTP API
HTTP API for Hindsight
The version of the OpenAPI document: 0.4.21
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
class TagGroupAndOutput(BaseModel):
"""
Compound AND group: all child filters must match.
""" # noqa: E501
var_and: List[MentalModelTriggerOutputTagGroupsInner] = Field(alias="and")
__properties: ClassVar[List[str]] = ["and"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of TagGroupAndOutput from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in var_and (list)
_items = []
if self.var_and:
for _item_var_and in self.var_and:
if _item_var_and:
_items.append(_item_var_and.to_dict())
_dict['and'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of TagGroupAndOutput from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"and": [MentalModelTriggerOutputTagGroupsInner.from_dict(_item) for _item in obj["and"]] if obj.get("and") is not None else None
})
return _obj
from hindsight_client_api.models.mental_model_trigger_output_tag_groups_inner import MentalModelTriggerOutputTagGroupsInner
# TODO: Rewrite to not use raise_errors
TagGroupAndOutput.model_rebuild(raise_errors=False)

View file

@ -22,7 +22,7 @@ from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
class TagGroupNot(BaseModel):
class TagGroupNotInput(BaseModel):
"""
Compound NOT group: child filter must NOT match.
""" # noqa: E501
@ -47,7 +47,7 @@ class TagGroupNot(BaseModel):
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of TagGroupNot from a JSON string"""
"""Create an instance of TagGroupNotInput from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
@ -75,7 +75,7 @@ class TagGroupNot(BaseModel):
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of TagGroupNot from a dict"""
"""Create an instance of TagGroupNotInput from a dict"""
if obj is None:
return None
@ -89,5 +89,5 @@ class TagGroupNot(BaseModel):
from hindsight_client_api.models.model_not import ModelNot
# TODO: Rewrite to not use raise_errors
TagGroupNot.model_rebuild(raise_errors=False)
TagGroupNotInput.model_rebuild(raise_errors=False)

View file

@ -0,0 +1,93 @@
# coding: utf-8
"""
Hindsight HTTP API
HTTP API for Hindsight
The version of the OpenAPI document: 0.4.21
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
class TagGroupNotOutput(BaseModel):
"""
Compound NOT group: child filter must NOT match.
""" # noqa: E501
var_not: Not1 = Field(alias="not")
__properties: ClassVar[List[str]] = ["not"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of TagGroupNotOutput from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of var_not
if self.var_not:
_dict['not'] = self.var_not.to_dict()
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of TagGroupNotOutput from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"not": Not1.from_dict(obj["not"]) if obj.get("not") is not None else None
})
return _obj
from hindsight_client_api.models.not1 import Not1
# TODO: Rewrite to not use raise_errors
TagGroupNotOutput.model_rebuild(raise_errors=False)

View file

@ -22,11 +22,11 @@ from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
class TagGroupOr(BaseModel):
class TagGroupOrInput(BaseModel):
"""
Compound OR group: at least one child filter must match.
""" # noqa: E501
var_or: List[RecallRequestTagGroupsInner] = Field(alias="or")
var_or: List[MentalModelTriggerInputTagGroupsInner] = Field(alias="or")
__properties: ClassVar[List[str]] = ["or"]
model_config = ConfigDict(
@ -47,7 +47,7 @@ class TagGroupOr(BaseModel):
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of TagGroupOr from a JSON string"""
"""Create an instance of TagGroupOrInput from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
@ -79,7 +79,7 @@ class TagGroupOr(BaseModel):
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of TagGroupOr from a dict"""
"""Create an instance of TagGroupOrInput from a dict"""
if obj is None:
return None
@ -87,11 +87,11 @@ class TagGroupOr(BaseModel):
return cls.model_validate(obj)
_obj = cls.model_validate({
"or": [RecallRequestTagGroupsInner.from_dict(_item) for _item in obj["or"]] if obj.get("or") is not None else None
"or": [MentalModelTriggerInputTagGroupsInner.from_dict(_item) for _item in obj["or"]] if obj.get("or") is not None else None
})
return _obj
from hindsight_client_api.models.recall_request_tag_groups_inner import RecallRequestTagGroupsInner
from hindsight_client_api.models.mental_model_trigger_input_tag_groups_inner import MentalModelTriggerInputTagGroupsInner
# TODO: Rewrite to not use raise_errors
TagGroupOr.model_rebuild(raise_errors=False)
TagGroupOrInput.model_rebuild(raise_errors=False)

View file

@ -0,0 +1,97 @@
# coding: utf-8
"""
Hindsight HTTP API
HTTP API for Hindsight
The version of the OpenAPI document: 0.4.21
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
class TagGroupOrOutput(BaseModel):
"""
Compound OR group: at least one child filter must match.
""" # noqa: E501
var_or: List[MentalModelTriggerOutputTagGroupsInner] = Field(alias="or")
__properties: ClassVar[List[str]] = ["or"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of TagGroupOrOutput from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in var_or (list)
_items = []
if self.var_or:
for _item_var_or in self.var_or:
if _item_var_or:
_items.append(_item_var_or.to_dict())
_dict['or'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of TagGroupOrOutput from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"or": [MentalModelTriggerOutputTagGroupsInner.from_dict(_item) for _item in obj["or"]] if obj.get("or") is not None else None
})
return _obj
from hindsight_client_api.models.mental_model_trigger_output_tag_groups_inner import MentalModelTriggerOutputTagGroupsInner
# TODO: Rewrite to not use raise_errors
TagGroupOrOutput.model_rebuild(raise_errors=False)

View file

@ -20,7 +20,7 @@ import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from hindsight_client_api.models.mental_model_trigger import MentalModelTrigger
from hindsight_client_api.models.mental_model_trigger_input import MentalModelTriggerInput
from typing import Optional, Set
from typing_extensions import Self
@ -32,7 +32,7 @@ class UpdateMentalModelRequest(BaseModel):
source_query: Optional[StrictStr] = None
max_tokens: Optional[Annotated[int, Field(le=8192, strict=True, ge=256)]] = None
tags: Optional[List[StrictStr]] = None
trigger: Optional[MentalModelTrigger] = None
trigger: Optional[MentalModelTriggerInput] = None
__properties: ClassVar[List[str]] = ["name", "source_query", "max_tokens", "tags", "trigger"]
model_config = ConfigDict(
@ -118,7 +118,7 @@ class UpdateMentalModelRequest(BaseModel):
"source_query": obj.get("source_query"),
"max_tokens": obj.get("max_tokens"),
"tags": obj.get("tags"),
"trigger": MentalModelTrigger.from_dict(obj["trigger"]) if obj.get("trigger") is not None else None
"trigger": MentalModelTriggerInput.from_dict(obj["trigger"]) if obj.get("trigger") is not None else None
})
return _obj

View file

@ -729,7 +729,7 @@ export type CreateMentalModelRequest = {
/**
* Trigger settings
*/
trigger?: MentalModelTrigger;
trigger?: MentalModelTriggerInput;
};
/**
@ -1450,7 +1450,7 @@ export type MentalModelResponse = {
* Max Tokens
*/
max_tokens?: number;
trigger?: MentalModelTrigger;
trigger?: MentalModelTriggerOutput;
/**
* Last Refreshed At
*/
@ -1474,7 +1474,7 @@ export type MentalModelResponse = {
*
* Trigger settings for a mental model.
*/
export type MentalModelTrigger = {
export type MentalModelTriggerInput = {
/**
* Refresh After Consolidation
*
@ -1499,6 +1499,66 @@ export type MentalModelTrigger = {
* Exclude specific mental models by ID from the reflect loop.
*/
exclude_mental_model_ids?: Array<string> | null;
/**
* Tags Match
*
* Override how the model's tags filter memories during refresh. If not set, defaults to 'all_strict' when the model has tags (security isolation) or 'any' when the model has no tags. Set to 'any' to include untagged memories alongside tagged ones during refresh.
*/
tags_match?: "any" | "all" | "any_strict" | "all_strict" | null;
/**
* Tag Groups
*
* Compound boolean tag expressions to use during refresh instead of the model's own tags. When set, these tag groups are passed to reflect and the model's flat tags are NOT used for filtering. Supports nested and/or/not expressions for complex tag-based scoping.
*/
tag_groups?: Array<
TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput
> | null;
};
/**
* MentalModelTrigger
*
* Trigger settings for a mental model.
*/
export type MentalModelTriggerOutput = {
/**
* Refresh After Consolidation
*
* If true, refresh this mental model after observations consolidation (real-time mode)
*/
refresh_after_consolidation?: boolean;
/**
* Fact Types
*
* Filter which fact types are retrieved during reflect. None means all types (world, experience, observation).
*/
fact_types?: Array<"world" | "experience" | "observation"> | null;
/**
* Exclude Mental Models
*
* If true, exclude all mental models from the reflect loop (skip search_mental_models tool).
*/
exclude_mental_models?: boolean;
/**
* Exclude Mental Model Ids
*
* Exclude specific mental models by ID from the reflect loop.
*/
exclude_mental_model_ids?: Array<string> | null;
/**
* Tags Match
*
* Override how the model's tags filter memories during refresh. If not set, defaults to 'all_strict' when the model has tags (security isolation) or 'any' when the model has no tags. Set to 'any' to include untagged memories alongside tagged ones during refresh.
*/
tags_match?: "any" | "all" | "any_strict" | "all_strict" | null;
/**
* Tag Groups
*
* Compound boolean tag expressions to use during refresh instead of the model's own tags. When set, these tag groups are passed to reflect and the model's flat tags are NOT used for filtering. Supports nested and/or/not expressions for complex tag-based scoping.
*/
tag_groups?: Array<
TagGroupLeaf | TagGroupAndOutput | TagGroupOrOutput | TagGroupNotOutput
> | null;
};
/**
@ -1668,7 +1728,7 @@ export type RecallRequest = {
* Compound tag filter using boolean groups. Groups in the list are AND-ed. Each group is a leaf {tags, match} or compound {and: [...]}, {or: [...]}, {not: ...}.
*/
tag_groups?: Array<
TagGroupLeaf | TagGroupAnd | TagGroupOr | TagGroupNot
TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput
> | null;
};
@ -1991,7 +2051,7 @@ export type ReflectRequest = {
* Compound tag filter using boolean groups. Groups in the list are AND-ed. Each group is a leaf {tags, match} or compound {and: [...]}, {or: [...]}, {not: ...}.
*/
tag_groups?: Array<
TagGroupLeaf | TagGroupAnd | TagGroupOr | TagGroupNot
TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput
> | null;
/**
* Fact Types
@ -2222,11 +2282,27 @@ export type SourceFactsIncludeOptions = {
*
* Compound AND group: all child filters must match.
*/
export type TagGroupAnd = {
export type TagGroupAndInput = {
/**
* And
*/
and: Array<TagGroupLeaf | TagGroupAnd | TagGroupOr | TagGroupNot>;
and: Array<
TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput
>;
};
/**
* TagGroupAnd
*
* Compound AND group: all child filters must match.
*/
export type TagGroupAndOutput = {
/**
* And
*/
and: Array<
TagGroupLeaf | TagGroupAndOutput | TagGroupOrOutput | TagGroupNotOutput
>;
};
/**
@ -2250,11 +2326,23 @@ export type TagGroupLeaf = {
*
* Compound NOT group: child filter must NOT match.
*/
export type TagGroupNot = {
export type TagGroupNotInput = {
/**
* Not
*/
not: TagGroupLeaf | TagGroupAnd | TagGroupOr | TagGroupNot;
not: TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput;
};
/**
* TagGroupNot
*
* Compound NOT group: child filter must NOT match.
*/
export type TagGroupNotOutput = {
/**
* Not
*/
not: TagGroupLeaf | TagGroupAndOutput | TagGroupOrOutput | TagGroupNotOutput;
};
/**
@ -2262,11 +2350,27 @@ export type TagGroupNot = {
*
* Compound OR group: at least one child filter must match.
*/
export type TagGroupOr = {
export type TagGroupOrInput = {
/**
* Or
*/
or: Array<TagGroupLeaf | TagGroupAnd | TagGroupOr | TagGroupNot>;
or: Array<
TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput
>;
};
/**
* TagGroupOr
*
* Compound OR group: at least one child filter must match.
*/
export type TagGroupOrOutput = {
/**
* Or
*/
or: Array<
TagGroupLeaf | TagGroupAndOutput | TagGroupOrOutput | TagGroupNotOutput
>;
};
/**
@ -2438,7 +2542,7 @@ export type UpdateMentalModelRequest = {
/**
* Trigger settings
*/
trigger?: MentalModelTrigger | null;
trigger?: MentalModelTriggerInput | null;
};
/**

View file

@ -3,12 +3,20 @@
import { useState, useEffect } from "react";
import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";
import { client } from "@/lib/api";
import { client, type TagGroup, type TagsMatch } from "@/lib/api";
import { useBank } from "@/lib/bank-context";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import { Checkbox } from "@/components/ui/checkbox";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { FactType, FactTypeCheckboxGroup } from "@/components/fact-type-filter";
import { toast } from "sonner";
import { Card, CardContent } from "@/components/ui/card";
@ -91,6 +99,8 @@ interface MentalModel {
fact_types?: Array<"world" | "experience" | "observation">;
exclude_mental_models?: boolean;
exclude_mental_model_ids?: string[];
tags_match?: TagsMatch;
tag_groups?: TagGroup[];
};
last_refreshed_at: string;
created_at: string;
@ -601,6 +611,8 @@ function CreateMentalModelDialog({
factTypes: [] as Array<"world" | "experience" | "observation">,
excludeMentalModels: false,
excludeMentalModelIds: "",
tagsMatch: "" as string,
tagGroups: "",
});
const handleCreate = async () => {
@ -621,6 +633,16 @@ function CreateMentalModelDialog({
.map((s) => s.trim())
.filter((s) => s.length > 0);
let tagGroups: TagGroup[] | undefined;
if (form.tagGroups.trim()) {
try {
tagGroups = JSON.parse(form.tagGroups.trim());
} catch {
toast.error("Invalid JSON in Tag Groups field");
return;
}
}
await client.createMentalModel(currentBank, {
id: form.id.trim() || undefined,
name: form.name.trim(),
@ -632,6 +654,8 @@ function CreateMentalModelDialog({
fact_types: form.factTypes.length > 0 ? form.factTypes : undefined,
exclude_mental_models: form.excludeMentalModels || undefined,
exclude_mental_model_ids: excludeIds.length > 0 ? excludeIds : undefined,
tags_match: (form.tagsMatch as TagsMatch) || undefined,
tag_groups: tagGroups,
},
});
@ -645,6 +669,8 @@ function CreateMentalModelDialog({
factTypes: [],
excludeMentalModels: false,
excludeMentalModelIds: "",
tagsMatch: "",
tagGroups: "",
});
onCreated();
} catch (error) {
@ -669,6 +695,8 @@ function CreateMentalModelDialog({
factTypes: [],
excludeMentalModels: false,
excludeMentalModelIds: "",
tagsMatch: "",
tagGroups: "",
});
onClose();
}
@ -786,6 +814,45 @@ function CreateMentalModelDialog({
placeholder="e.g., model-a, model-b (comma-separated)"
/>
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-foreground">Tags Match</label>
<Select
value={form.tagsMatch}
onValueChange={(v) => setForm({ ...form, tagsMatch: v === "default" ? "" : v })}
>
<SelectTrigger>
<SelectValue placeholder="Default (all_strict when tags set)" />
</SelectTrigger>
<SelectContent>
<SelectItem value="default">Default (all_strict when tags set)</SelectItem>
<SelectItem value="any">any OR matching, includes untagged</SelectItem>
<SelectItem value="all">all AND matching, includes untagged</SelectItem>
<SelectItem value="any_strict">
any_strict OR matching, excludes untagged
</SelectItem>
<SelectItem value="all_strict">
all_strict AND matching, excludes untagged
</SelectItem>
</SelectContent>
</Select>
<p className="text-xs text-muted-foreground">
Controls how the model&apos;s tags filter memories during refresh.
</p>
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-foreground">Tag Groups (JSON)</label>
<Textarea
value={form.tagGroups}
onChange={(e) => setForm({ ...form, tagGroups: e.target.value })}
placeholder='e.g., [{"or": [{"tags": ["user:alice"], "match": "all_strict"}, {"tags": ["shared"]}]}]'
rows={3}
className="font-mono text-xs"
/>
<p className="text-xs text-muted-foreground">
Compound boolean tag expressions for refresh filtering. Overrides flat tags when
set.
</p>
</div>
</TabsContent>
</Tabs>
@ -837,6 +904,10 @@ function UpdateMentalModelDialog({
| undefined) || [],
excludeMentalModels: mentalModel.trigger?.exclude_mental_models || false,
excludeMentalModelIds: (mentalModel.trigger?.exclude_mental_model_ids || []).join(", "),
tagsMatch: (mentalModel.trigger?.tags_match as string) || "",
tagGroups: mentalModel.trigger?.tag_groups
? JSON.stringify(mentalModel.trigger.tag_groups, null, 2)
: "",
});
// Reset form when mental model changes or dialog opens
@ -854,6 +925,10 @@ function UpdateMentalModelDialog({
| undefined) || [],
excludeMentalModels: mentalModel.trigger?.exclude_mental_models || false,
excludeMentalModelIds: (mentalModel.trigger?.exclude_mental_model_ids || []).join(", "),
tagsMatch: (mentalModel.trigger?.tags_match as string) || "",
tagGroups: mentalModel.trigger?.tag_groups
? JSON.stringify(mentalModel.trigger.tag_groups, null, 2)
: "",
});
}
}, [open, mentalModel]);
@ -875,6 +950,16 @@ function UpdateMentalModelDialog({
.map((s) => s.trim())
.filter((s) => s.length > 0);
let tagGroups: TagGroup[] | undefined;
if (form.tagGroups.trim()) {
try {
tagGroups = JSON.parse(form.tagGroups.trim());
} catch {
toast.error("Invalid JSON in Tag Groups field");
return;
}
}
const updated = await client.updateMentalModel(currentBank, mentalModel.id, {
name: form.name.trim(),
source_query: form.sourceQuery.trim(),
@ -885,6 +970,8 @@ function UpdateMentalModelDialog({
fact_types: form.factTypes.length > 0 ? form.factTypes : undefined,
exclude_mental_models: form.excludeMentalModels || undefined,
exclude_mental_model_ids: excludeIds.length > 0 ? excludeIds : undefined,
tags_match: (form.tagsMatch as TagsMatch) || undefined,
tag_groups: tagGroups,
},
});
@ -1006,6 +1093,45 @@ function UpdateMentalModelDialog({
placeholder="e.g., model-a, model-b (comma-separated)"
/>
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-foreground">Tags Match</label>
<Select
value={form.tagsMatch || "default"}
onValueChange={(v) => setForm({ ...form, tagsMatch: v === "default" ? "" : v })}
>
<SelectTrigger>
<SelectValue placeholder="Default (all_strict when tags set)" />
</SelectTrigger>
<SelectContent>
<SelectItem value="default">Default (all_strict when tags set)</SelectItem>
<SelectItem value="any">any OR matching, includes untagged</SelectItem>
<SelectItem value="all">all AND matching, includes untagged</SelectItem>
<SelectItem value="any_strict">
any_strict OR matching, excludes untagged
</SelectItem>
<SelectItem value="all_strict">
all_strict AND matching, excludes untagged
</SelectItem>
</SelectContent>
</Select>
<p className="text-xs text-muted-foreground">
Controls how the model&apos;s tags filter memories during refresh.
</p>
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-foreground">Tag Groups (JSON)</label>
<Textarea
value={form.tagGroups}
onChange={(e) => setForm({ ...form, tagGroups: e.target.value })}
placeholder='e.g., [{"or": [{"tags": ["user:alice"], "match": "all_strict"}, {"tags": ["shared"]}]}]'
rows={3}
className="font-mono text-xs"
/>
<p className="text-xs text-muted-foreground">
Compound boolean tag expressions for refresh filtering. Overrides flat tags when
set.
</p>
</div>
</TabsContent>
</Tabs>

View file

@ -73,6 +73,14 @@ export interface AuditStatsResponse {
buckets: AuditStatsBucket[];
}
export type TagsMatch = "any" | "all" | "any_strict" | "all_strict";
export type TagGroup =
| { tags: string[]; match?: TagsMatch }
| { and: TagGroup[] }
| { or: TagGroup[] }
| { not: TagGroup };
export interface MentalModel {
id: string;
bank_id: string;
@ -86,6 +94,8 @@ export interface MentalModel {
fact_types?: Array<"world" | "experience" | "observation">;
exclude_mental_models?: boolean;
exclude_mental_model_ids?: string[];
tags_match?: TagsMatch;
tag_groups?: TagGroup[];
};
last_refreshed_at: string;
created_at: string;
@ -804,6 +814,8 @@ export class ControlPlaneClient {
fact_types?: Array<"world" | "experience" | "observation">;
exclude_mental_models?: boolean;
exclude_mental_model_ids?: string[];
tags_match?: TagsMatch;
tag_groups?: TagGroup[];
};
last_refreshed_at: string;
created_at: string;
@ -832,6 +844,8 @@ export class ControlPlaneClient {
fact_types?: Array<"world" | "experience" | "observation">;
exclude_mental_models?: boolean;
exclude_mental_model_ids?: string[];
tags_match?: TagsMatch;
tag_groups?: TagGroup[];
};
}
) {
@ -866,6 +880,8 @@ export class ControlPlaneClient {
fact_types?: Array<"world" | "experience" | "observation">;
exclude_mental_models?: boolean;
exclude_mental_model_ids?: string[];
tags_match?: TagsMatch;
tag_groups?: TagGroup[];
};
}
) {
@ -882,6 +898,8 @@ export class ControlPlaneClient {
fact_types?: Array<"world" | "experience" | "observation">;
exclude_mental_models?: boolean;
exclude_mental_model_ids?: string[];
tags_match?: TagsMatch;
tag_groups?: TagGroup[];
};
last_refreshed_at: string;
created_at: string;

View file

@ -81,7 +81,7 @@ func main() {
CreateMentalModelRequest(hindsight.CreateMentalModelRequest{
Name: "Project Status",
SourceQuery: "What is the current project status?",
Trigger: &hindsight.MentalModelTrigger{
Trigger: &hindsight.MentalModelTriggerInput{
RefreshAfterConsolidation: &refreshTrue,
},
}).Execute()
@ -132,7 +132,7 @@ func main() {
updated, _, _ := client.MentalModelsAPI.UpdateMentalModel(ctx, mmBankID, mentalModelID).
UpdateMentalModelRequest(hindsight.UpdateMentalModelRequest{
Name: *hindsight.NewNullableString(&newName),
Trigger: *hindsight.NewNullableMentalModelTrigger(&hindsight.MentalModelTrigger{
Trigger: *hindsight.NewNullableMentalModelTriggerInput(&hindsight.MentalModelTriggerInput{
RefreshAfterConsolidation: &refreshAfter,
}),
}).Execute()

View file

@ -5470,7 +5470,7 @@
"default": 2048
},
"trigger": {
"$ref": "#/components/schemas/MentalModelTrigger",
"$ref": "#/components/schemas/MentalModelTrigger-Input",
"description": "Trigger settings",
"default": {}
}
@ -6728,7 +6728,7 @@
"default": 2048
},
"trigger": {
"$ref": "#/components/schemas/MentalModelTrigger",
"$ref": "#/components/schemas/MentalModelTrigger-Output",
"default": {}
},
"last_refreshed_at": {
@ -6778,7 +6778,7 @@
"title": "MentalModelResponse",
"description": "Response model for a mental model (stored reflect response)."
},
"MentalModelTrigger": {
"MentalModelTrigger-Input": {
"properties": {
"refresh_after_consolidation": {
"type": "boolean",
@ -6826,6 +6826,152 @@
],
"title": "Exclude Mental Model Ids",
"description": "Exclude specific mental models by ID from the reflect loop."
},
"tags_match": {
"anyOf": [
{
"type": "string",
"enum": [
"any",
"all",
"any_strict",
"all_strict"
]
},
{
"type": "null"
}
],
"title": "Tags Match",
"description": "Override how the model's tags filter memories during refresh. If not set, defaults to 'all_strict' when the model has tags (security isolation) or 'any' when the model has no tags. Set to 'any' to include untagged memories alongside tagged ones during refresh."
},
"tag_groups": {
"anyOf": [
{
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd-Input"
},
{
"$ref": "#/components/schemas/TagGroupOr-Input"
},
{
"$ref": "#/components/schemas/TagGroupNot-Input"
}
]
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Tag Groups",
"description": "Compound boolean tag expressions to use during refresh instead of the model's own tags. When set, these tag groups are passed to reflect and the model's flat tags are NOT used for filtering. Supports nested and/or/not expressions for complex tag-based scoping."
}
},
"type": "object",
"title": "MentalModelTrigger",
"description": "Trigger settings for a mental model."
},
"MentalModelTrigger-Output": {
"properties": {
"refresh_after_consolidation": {
"type": "boolean",
"title": "Refresh After Consolidation",
"description": "If true, refresh this mental model after observations consolidation (real-time mode)",
"default": false
},
"fact_types": {
"anyOf": [
{
"items": {
"type": "string",
"enum": [
"world",
"experience",
"observation"
]
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Fact Types",
"description": "Filter which fact types are retrieved during reflect. None means all types (world, experience, observation)."
},
"exclude_mental_models": {
"type": "boolean",
"title": "Exclude Mental Models",
"description": "If true, exclude all mental models from the reflect loop (skip search_mental_models tool).",
"default": false
},
"exclude_mental_model_ids": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Exclude Mental Model Ids",
"description": "Exclude specific mental models by ID from the reflect loop."
},
"tags_match": {
"anyOf": [
{
"type": "string",
"enum": [
"any",
"all",
"any_strict",
"all_strict"
]
},
{
"type": "null"
}
],
"title": "Tags Match",
"description": "Override how the model's tags filter memories during refresh. If not set, defaults to 'all_strict' when the model has tags (security isolation) or 'any' when the model has no tags. Set to 'any' to include untagged memories alongside tagged ones during refresh."
},
"tag_groups": {
"anyOf": [
{
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd-Output"
},
{
"$ref": "#/components/schemas/TagGroupOr-Output"
},
{
"$ref": "#/components/schemas/TagGroupNot-Output"
}
]
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Tag Groups",
"description": "Compound boolean tag expressions to use during refresh instead of the model's own tags. When set, these tag groups are passed to reflect and the model's flat tags are NOT used for filtering. Supports nested and/or/not expressions for complex tag-based scoping."
}
},
"type": "object",
@ -7151,13 +7297,13 @@
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd"
"$ref": "#/components/schemas/TagGroupAnd-Input"
},
{
"$ref": "#/components/schemas/TagGroupOr"
"$ref": "#/components/schemas/TagGroupOr-Input"
},
{
"$ref": "#/components/schemas/TagGroupNot"
"$ref": "#/components/schemas/TagGroupNot-Input"
}
]
},
@ -7808,13 +7954,13 @@
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd"
"$ref": "#/components/schemas/TagGroupAnd-Input"
},
{
"$ref": "#/components/schemas/TagGroupOr"
"$ref": "#/components/schemas/TagGroupOr-Input"
},
{
"$ref": "#/components/schemas/TagGroupNot"
"$ref": "#/components/schemas/TagGroupNot-Input"
}
]
},
@ -8274,7 +8420,7 @@
"title": "SourceFactsIncludeOptions",
"description": "Options for including source facts for observation-type results."
},
"TagGroupAnd": {
"TagGroupAnd-Input": {
"properties": {
"and": {
"items": {
@ -8283,13 +8429,43 @@
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd"
"$ref": "#/components/schemas/TagGroupAnd-Input"
},
{
"$ref": "#/components/schemas/TagGroupOr"
"$ref": "#/components/schemas/TagGroupOr-Input"
},
{
"$ref": "#/components/schemas/TagGroupNot"
"$ref": "#/components/schemas/TagGroupNot-Input"
}
]
},
"type": "array",
"title": "And"
}
},
"type": "object",
"required": [
"and"
],
"title": "TagGroupAnd",
"description": "Compound AND group: all child filters must match."
},
"TagGroupAnd-Output": {
"properties": {
"and": {
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd-Output"
},
{
"$ref": "#/components/schemas/TagGroupOr-Output"
},
{
"$ref": "#/components/schemas/TagGroupNot-Output"
}
]
},
@ -8332,7 +8508,7 @@
"title": "TagGroupLeaf",
"description": "A leaf tag filter: matches memories by tag list and match mode."
},
"TagGroupNot": {
"TagGroupNot-Input": {
"properties": {
"not": {
"anyOf": [
@ -8340,13 +8516,13 @@
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd"
"$ref": "#/components/schemas/TagGroupAnd-Input"
},
{
"$ref": "#/components/schemas/TagGroupOr"
"$ref": "#/components/schemas/TagGroupOr-Input"
},
{
"$ref": "#/components/schemas/TagGroupNot"
"$ref": "#/components/schemas/TagGroupNot-Input"
}
],
"title": "Not"
@ -8359,7 +8535,34 @@
"title": "TagGroupNot",
"description": "Compound NOT group: child filter must NOT match."
},
"TagGroupOr": {
"TagGroupNot-Output": {
"properties": {
"not": {
"anyOf": [
{
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd-Output"
},
{
"$ref": "#/components/schemas/TagGroupOr-Output"
},
{
"$ref": "#/components/schemas/TagGroupNot-Output"
}
],
"title": "Not"
}
},
"type": "object",
"required": [
"not"
],
"title": "TagGroupNot",
"description": "Compound NOT group: child filter must NOT match."
},
"TagGroupOr-Input": {
"properties": {
"or": {
"items": {
@ -8368,13 +8571,43 @@
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd"
"$ref": "#/components/schemas/TagGroupAnd-Input"
},
{
"$ref": "#/components/schemas/TagGroupOr"
"$ref": "#/components/schemas/TagGroupOr-Input"
},
{
"$ref": "#/components/schemas/TagGroupNot"
"$ref": "#/components/schemas/TagGroupNot-Input"
}
]
},
"type": "array",
"title": "Or"
}
},
"type": "object",
"required": [
"or"
],
"title": "TagGroupOr",
"description": "Compound OR group: at least one child filter must match."
},
"TagGroupOr-Output": {
"properties": {
"or": {
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd-Output"
},
{
"$ref": "#/components/schemas/TagGroupOr-Output"
},
{
"$ref": "#/components/schemas/TagGroupNot-Output"
}
]
},
@ -8634,7 +8867,7 @@
"trigger": {
"anyOf": [
{
"$ref": "#/components/schemas/MentalModelTrigger"
"$ref": "#/components/schemas/MentalModelTrigger-Input"
},
{
"type": "null"

View file

@ -5470,7 +5470,7 @@
"default": 2048
},
"trigger": {
"$ref": "#/components/schemas/MentalModelTrigger",
"$ref": "#/components/schemas/MentalModelTrigger-Input",
"description": "Trigger settings",
"default": {}
}
@ -6728,7 +6728,7 @@
"default": 2048
},
"trigger": {
"$ref": "#/components/schemas/MentalModelTrigger",
"$ref": "#/components/schemas/MentalModelTrigger-Output",
"default": {}
},
"last_refreshed_at": {
@ -6778,7 +6778,7 @@
"title": "MentalModelResponse",
"description": "Response model for a mental model (stored reflect response)."
},
"MentalModelTrigger": {
"MentalModelTrigger-Input": {
"properties": {
"refresh_after_consolidation": {
"type": "boolean",
@ -6826,6 +6826,152 @@
],
"title": "Exclude Mental Model Ids",
"description": "Exclude specific mental models by ID from the reflect loop."
},
"tags_match": {
"anyOf": [
{
"type": "string",
"enum": [
"any",
"all",
"any_strict",
"all_strict"
]
},
{
"type": "null"
}
],
"title": "Tags Match",
"description": "Override how the model's tags filter memories during refresh. If not set, defaults to 'all_strict' when the model has tags (security isolation) or 'any' when the model has no tags. Set to 'any' to include untagged memories alongside tagged ones during refresh."
},
"tag_groups": {
"anyOf": [
{
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd-Input"
},
{
"$ref": "#/components/schemas/TagGroupOr-Input"
},
{
"$ref": "#/components/schemas/TagGroupNot-Input"
}
]
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Tag Groups",
"description": "Compound boolean tag expressions to use during refresh instead of the model's own tags. When set, these tag groups are passed to reflect and the model's flat tags are NOT used for filtering. Supports nested and/or/not expressions for complex tag-based scoping."
}
},
"type": "object",
"title": "MentalModelTrigger",
"description": "Trigger settings for a mental model."
},
"MentalModelTrigger-Output": {
"properties": {
"refresh_after_consolidation": {
"type": "boolean",
"title": "Refresh After Consolidation",
"description": "If true, refresh this mental model after observations consolidation (real-time mode)",
"default": false
},
"fact_types": {
"anyOf": [
{
"items": {
"type": "string",
"enum": [
"world",
"experience",
"observation"
]
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Fact Types",
"description": "Filter which fact types are retrieved during reflect. None means all types (world, experience, observation)."
},
"exclude_mental_models": {
"type": "boolean",
"title": "Exclude Mental Models",
"description": "If true, exclude all mental models from the reflect loop (skip search_mental_models tool).",
"default": false
},
"exclude_mental_model_ids": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Exclude Mental Model Ids",
"description": "Exclude specific mental models by ID from the reflect loop."
},
"tags_match": {
"anyOf": [
{
"type": "string",
"enum": [
"any",
"all",
"any_strict",
"all_strict"
]
},
{
"type": "null"
}
],
"title": "Tags Match",
"description": "Override how the model's tags filter memories during refresh. If not set, defaults to 'all_strict' when the model has tags (security isolation) or 'any' when the model has no tags. Set to 'any' to include untagged memories alongside tagged ones during refresh."
},
"tag_groups": {
"anyOf": [
{
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd-Output"
},
{
"$ref": "#/components/schemas/TagGroupOr-Output"
},
{
"$ref": "#/components/schemas/TagGroupNot-Output"
}
]
},
"type": "array"
},
{
"type": "null"
}
],
"title": "Tag Groups",
"description": "Compound boolean tag expressions to use during refresh instead of the model's own tags. When set, these tag groups are passed to reflect and the model's flat tags are NOT used for filtering. Supports nested and/or/not expressions for complex tag-based scoping."
}
},
"type": "object",
@ -7151,13 +7297,13 @@
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd"
"$ref": "#/components/schemas/TagGroupAnd-Input"
},
{
"$ref": "#/components/schemas/TagGroupOr"
"$ref": "#/components/schemas/TagGroupOr-Input"
},
{
"$ref": "#/components/schemas/TagGroupNot"
"$ref": "#/components/schemas/TagGroupNot-Input"
}
]
},
@ -7808,13 +7954,13 @@
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd"
"$ref": "#/components/schemas/TagGroupAnd-Input"
},
{
"$ref": "#/components/schemas/TagGroupOr"
"$ref": "#/components/schemas/TagGroupOr-Input"
},
{
"$ref": "#/components/schemas/TagGroupNot"
"$ref": "#/components/schemas/TagGroupNot-Input"
}
]
},
@ -8274,7 +8420,7 @@
"title": "SourceFactsIncludeOptions",
"description": "Options for including source facts for observation-type results."
},
"TagGroupAnd": {
"TagGroupAnd-Input": {
"properties": {
"and": {
"items": {
@ -8283,13 +8429,43 @@
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd"
"$ref": "#/components/schemas/TagGroupAnd-Input"
},
{
"$ref": "#/components/schemas/TagGroupOr"
"$ref": "#/components/schemas/TagGroupOr-Input"
},
{
"$ref": "#/components/schemas/TagGroupNot"
"$ref": "#/components/schemas/TagGroupNot-Input"
}
]
},
"type": "array",
"title": "And"
}
},
"type": "object",
"required": [
"and"
],
"title": "TagGroupAnd",
"description": "Compound AND group: all child filters must match."
},
"TagGroupAnd-Output": {
"properties": {
"and": {
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd-Output"
},
{
"$ref": "#/components/schemas/TagGroupOr-Output"
},
{
"$ref": "#/components/schemas/TagGroupNot-Output"
}
]
},
@ -8332,7 +8508,7 @@
"title": "TagGroupLeaf",
"description": "A leaf tag filter: matches memories by tag list and match mode."
},
"TagGroupNot": {
"TagGroupNot-Input": {
"properties": {
"not": {
"anyOf": [
@ -8340,13 +8516,13 @@
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd"
"$ref": "#/components/schemas/TagGroupAnd-Input"
},
{
"$ref": "#/components/schemas/TagGroupOr"
"$ref": "#/components/schemas/TagGroupOr-Input"
},
{
"$ref": "#/components/schemas/TagGroupNot"
"$ref": "#/components/schemas/TagGroupNot-Input"
}
],
"title": "Not"
@ -8359,7 +8535,34 @@
"title": "TagGroupNot",
"description": "Compound NOT group: child filter must NOT match."
},
"TagGroupOr": {
"TagGroupNot-Output": {
"properties": {
"not": {
"anyOf": [
{
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd-Output"
},
{
"$ref": "#/components/schemas/TagGroupOr-Output"
},
{
"$ref": "#/components/schemas/TagGroupNot-Output"
}
],
"title": "Not"
}
},
"type": "object",
"required": [
"not"
],
"title": "TagGroupNot",
"description": "Compound NOT group: child filter must NOT match."
},
"TagGroupOr-Input": {
"properties": {
"or": {
"items": {
@ -8368,13 +8571,43 @@
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd"
"$ref": "#/components/schemas/TagGroupAnd-Input"
},
{
"$ref": "#/components/schemas/TagGroupOr"
"$ref": "#/components/schemas/TagGroupOr-Input"
},
{
"$ref": "#/components/schemas/TagGroupNot"
"$ref": "#/components/schemas/TagGroupNot-Input"
}
]
},
"type": "array",
"title": "Or"
}
},
"type": "object",
"required": [
"or"
],
"title": "TagGroupOr",
"description": "Compound OR group: at least one child filter must match."
},
"TagGroupOr-Output": {
"properties": {
"or": {
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/TagGroupLeaf"
},
{
"$ref": "#/components/schemas/TagGroupAnd-Output"
},
{
"$ref": "#/components/schemas/TagGroupOr-Output"
},
{
"$ref": "#/components/schemas/TagGroupNot-Output"
}
]
},
@ -8634,7 +8867,7 @@
"trigger": {
"anyOf": [
{
"$ref": "#/components/schemas/MentalModelTrigger"
"$ref": "#/components/schemas/MentalModelTrigger-Input"
},
{
"type": "null"