Skip to content

Commit ecc23be

Browse files
committed
When calling the agents with the call method without indicating the ChatHistory, even though the result is shown correctly, an error appears in the system out
Issue: 206106
1 parent 0840c8d commit ecc23be

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

common/src/main/java/com/genexus/GXExternalCollection.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,14 @@ public <E> ArrayList<E> getExternalInstance() {
120120
public void setExternalInstance(ArrayList<?> data)
121121
{
122122
try {
123-
clear();
124-
for (Object item : data) {
125-
T obj = elementsType.getConstructor(new Class[]{}).newInstance();
126-
obj.getClass().getMethod("setExternalInstance", item.getClass()).invoke(obj, item);
127-
super.add(obj);
128-
vectorExternal.add(item);
123+
if (elementsType != null) {
124+
clear();
125+
for (Object item : data) {
126+
T obj = elementsType.getConstructor(new Class[]{}).newInstance();
127+
obj.getClass().getMethod("setExternalInstance", item.getClass()).invoke(obj, item);
128+
super.add(obj);
129+
vectorExternal.add(item);
130+
}
129131
}
130132
}
131133
catch(Exception ex)

java/src/main/java/com/genexus/util/saia/OpenAIResponse.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@ public static class Message {
103103
public void setRole(String role) { this.role = role; }
104104

105105
@JsonIgnore
106-
public String getStringContent() { return ((StringContent) content).getValue(); }
106+
public String getStringContent() {
107+
if (content != null)
108+
return ((StringContent) content).getValue();
109+
110+
return null;
111+
}
107112
@JsonIgnore
108113
public StructuredContent getStructuredContent() {return (StructuredContent)content;}
109114
public Content getContent() { return content; }

0 commit comments

Comments
 (0)