Skip to content

Commit

Permalink
Add nested test cases for data_struct with structs and vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
steelgeek091 committed Jan 14, 2025
1 parent 0c1e651 commit 6687b78
Show file tree
Hide file tree
Showing 6 changed files with 216 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
processed 1 task

task 0 'publish'. lines 1-86:
status EXECUTED
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
//# publish
module 0x11.TestModule1 {
import 0x1.string;
import 0x2.table;
import 0x1.option;

struct Media has store, copy, drop {
id: string.String,
url: string.String,
title: string.String,
source: string.String,
description: string.String,
text: string.String,
contentType: string.String,
}

struct Content has store, copy, drop {
text: string.String,
action: option.Option<string.String>,
source: option.Option<string.String>,
url: option.Option<string.String>,
inReplyTo: option.Option<string.String>,
attachments: vector<Self.Media>,
}

struct Memory has store, copy, drop {
id: string.String,
userId: string.String,
agentId: string.String,
createdAt: option.Option<u64>,
content: Self.Content,
character: string.String,
embedding: vector<u128>,
roomId: string.String,
unique: bool,
similarity: option.Option<u128>,
}

struct MessageTemplate has store, copy, drop{
user: string.String,
content: Self.Content,
}

struct MemoryStore has key {
agent_account: address,
store: table.Table<string.String, Self.Memory>,
}

struct Style has store, copy, drop {
all: vector<string.String>,
chat: vector<string.String>,
post: vector<string.String>,
}

struct Character has key {
/// Optional UUID for the character.
id: option.Option<string.String>,
name: string.String,
username: string.String,
plugins: vector<string.String>,
clients: vector<string.String>,
modelProvider: string.String,
imageModelProvider: option.Option<string.String>,
imageVisionModelProvider: option.Option<string.String>,
modelEndpointOverride: option.Option<string.String>,
system: string.String,
bio: vector<string.String>,
lore: vector<string.String>,
messageExamples: vector<vector<Self.MessageTemplate>>,
postExamples: vector<string.String>,
topics: vector<string.String>,
style: Self.Style,
adjectives: vector<string.String>,
knowledge: vector<string.String>,
}

metadata {
data_struct {
0x11::TestModule1::Media -> true;
0x11::TestModule1::Content -> true;
0x11::TestModule1::Memory -> true;
0x11::TestModule1::Style -> true;
0x11::TestModule1::MessageTemplate -> true;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
processed 1 task

task 0 'publish'. lines 1-51:
status EXECUTED
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//# publish
module 0x11.TestModule1 {
import 0x1.string;
import 0x2.table;
import 0x1.option;

struct Media has store, copy, drop {
id: string.String,
url: string.String,
title: string.String,
source: string.String,
description: string.String,
text: string.String,
contentType: string.String,
}

struct Content has store, copy, drop {
text: string.String,
action: option.Option<string.String>,
source: option.Option<string.String>,
url: option.Option<string.String>,
inReplyTo: option.Option<string.String>,
attachments: vector<Self.Media>,
}

struct Memory has store, copy, drop {
id: string.String,
userId: string.String,
agentId: string.String,
createdAt: option.Option<u64>,
content: Self.Content,
character: string.String,
embedding: vector<u128>,
roomId: string.String,
unique: bool,
similarity: option.Option<u128>,
}

struct MemoryStore has key {
agent_account: address,
store: table.Table<string.String, Self.Memory>,
}

metadata {
data_struct {
0x11::TestModule1::Media -> true;
0x11::TestModule1::Content -> true;
0x11::TestModule1::Memory -> true;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
processed 1 task

task 0 'publish'. lines 1-67:
status EXECUTED
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//# publish
module 0x11.TestModule1 {
import 0x1.string;
import 0x2.table;
import 0x1.option;

struct Style has store, copy, drop {
all: vector<string.String>,
chat: vector<string.String>,
post: vector<string.String>,
}

struct Media has store, copy, drop {
id: string.String,
url: string.String,
title: string.String,
source: string.String,
description: string.String,
text: string.String,
contentType: string.String,
}

struct Content has store, copy, drop {
text: string.String,
action: option.Option<string.String>,
source: option.Option<string.String>,
url: option.Option<string.String>,
inReplyTo: option.Option<string.String>,
attachments: vector<Self.Media>,
}

struct MessageTemplate has store, copy, drop{
user: string.String,
content: Self.Content,
}

struct Character has key {
/// Optional UUID for the character.
id: option.Option<string.String>,
name: string.String,
username: string.String,
plugins: vector<string.String>,
clients: vector<string.String>,
modelProvider: string.String,
imageModelProvider: option.Option<string.String>,
imageVisionModelProvider: option.Option<string.String>,
modelEndpointOverride: option.Option<string.String>,
system: string.String,
bio: vector<string.String>,
lore: vector<string.String>,
messageExamples: vector<vector<Self.MessageTemplate>>,
postExamples: vector<string.String>,
topics: vector<string.String>,
style: Self.Style,
adjectives: vector<string.String>,
knowledge: vector<string.String>,
}

metadata {
data_struct {
0x11::TestModule1::Style -> true;
0x11::TestModule1::Content -> true;
0x11::TestModule1::Media -> true;
0x11::TestModule1::MessageTemplate -> true;
}
}
}

0 comments on commit 6687b78

Please sign in to comment.