@@ -1703,10 +1703,19 @@ private AiServiceMethodCreateInfo gatherMethodMetadata(
17031703 boolean switchToWorkerThreadForToolExecution = detectIfToolExecutionRequiresAWorkerThread (method , tools ,
17041704 methodToolClassInfo .keySet ());
17051705
1706- var methodReturnTypeSignature = returnTypeSignature (method .returnType (),
1707- new TypeArgMapper (method .declaringClass (), index ) );
1706+ TypeArgMapper typeArgMapper = new TypeArgMapper (method .declaringClass (), index );
1707+ var methodReturnTypeSignature = typeSignature (method .returnType (), typeArgMapper );
17081708
1709- return new AiServiceMethodCreateInfo (method .declaringClass ().name ().toString (), method .name (), systemMessageInfo ,
1709+ List <AiServiceMethodCreateInfo .ParameterInfo > parameterInfoList = new ArrayList <>();
1710+ for (MethodParameterInfo p : method .parameters ()) {
1711+ parameterInfoList .add (new AiServiceMethodCreateInfo .ParameterInfo (p .name (),
1712+ typeSignature (p .type (), typeArgMapper ),
1713+ p .declaredAnnotations ().stream ().map (an -> an .name ().toString ()).collect (
1714+ Collectors .toSet ())));
1715+ }
1716+
1717+ return new AiServiceMethodCreateInfo (method .declaringClass ().name ().toString (), method .name (), parameterInfoList ,
1718+ systemMessageInfo ,
17101719 userMessageInfo , memoryIdParamPosition , requiresModeration , methodReturnTypeSignature ,
17111720 overrideChatModelParamPosition , metricsTimedInfo , metricsCountedInfo , spanInfo , responseSchemaInfo ,
17121721 methodToolClassInfo , methodMcpClientNames , switchToWorkerThreadForToolExecution ,
@@ -1817,7 +1826,7 @@ private java.lang.reflect.Type javaLangReturnType(MethodInfo method) {
18171826 }
18181827 }
18191828
1820- private String returnTypeSignature (Type returnType , TypeArgMapper typeArgMapper ) {
1829+ private String typeSignature (Type returnType , TypeArgMapper typeArgMapper ) {
18211830 return AsmUtil .getSignature (returnType , typeArgMapper );
18221831 }
18231832
@@ -1979,7 +1988,7 @@ private AiServiceMethodCreateInfo.UserMessageInfo gatherUserMessageInfo(MethodIn
19791988 return AiServiceMethodCreateInfo .UserMessageInfo .fromTemplate (
19801989 AiServiceMethodCreateInfo .TemplateInfo .fromText (userMessageTemplate ,
19811990 TemplateParameterInfo .toNameToArgsPositionMap (templateParams )),
1982- userNameParamPosition , imageParamPosition , audioParamPosition , pdfParamPosition , videoParamPosition );
1991+ userNameParamPosition );
19831992 } else {
19841993 Optional <AnnotationInstance > userMessageOnMethodParam = method .annotations (LangChain4jDotNames .USER_MESSAGE )
19851994 .stream ()
@@ -1992,13 +2001,11 @@ private AiServiceMethodCreateInfo.UserMessageInfo gatherUserMessageInfo(MethodIn
19922001 Short .valueOf (userMessageOnMethodParam .get ().target ().asMethodParameter ().position ())
19932002 .intValue (),
19942003 TemplateParameterInfo .toNameToArgsPositionMap (templateParams )),
1995- userNameParamPosition , imageParamPosition , audioParamPosition , pdfParamPosition ,
1996- videoParamPosition );
2004+ userNameParamPosition );
19972005 } else {
19982006 return AiServiceMethodCreateInfo .UserMessageInfo .fromMethodParam (
19992007 userMessageOnMethodParam .get ().target ().asMethodParameter ().position (),
2000- userNameParamPosition , imageParamPosition , audioParamPosition , pdfParamPosition ,
2001- videoParamPosition );
2008+ userNameParamPosition );
20022009 }
20032010 } else {
20042011 Set <String > templateParamNames = Collections .EMPTY_SET ;
@@ -2031,9 +2038,7 @@ private AiServiceMethodCreateInfo.UserMessageInfo gatherUserMessageInfo(MethodIn
20312038 if (undefinedParams > 1 ) {
20322039 if (fallbackToDummyUserMesage .test (method )) {
20332040 return AiServiceMethodCreateInfo .UserMessageInfo .fromTemplate (
2034- AiServiceMethodCreateInfo .TemplateInfo .fromText ("" , Map .of ()), Optional .empty (),
2035- Optional .empty (),
2036- Optional .empty (), Optional .empty (), Optional .empty ());
2041+ AiServiceMethodCreateInfo .TemplateInfo .fromText ("" , Map .of ()), Optional .empty ());
20372042 }
20382043
20392044 throw illegalConfigurationForMethod (
@@ -2044,12 +2049,10 @@ private AiServiceMethodCreateInfo.UserMessageInfo gatherUserMessageInfo(MethodIn
20442049 }
20452050 if (userMessageParamPosition == -1 ) {
20462051 // There is no user message
2047- return new AiServiceMethodCreateInfo .UserMessageInfo (Optional .empty (), Optional .empty (), Optional .empty (),
2048- Optional .empty (), Optional .empty (), Optional .empty (), Optional .empty ());
2052+ return new AiServiceMethodCreateInfo .UserMessageInfo (Optional .empty (), Optional .empty (), Optional .empty ());
20492053 } else {
20502054 return AiServiceMethodCreateInfo .UserMessageInfo .fromMethodParam (userMessageParamPosition ,
2051- userNameParamPosition ,
2052- imageParamPosition , audioParamPosition , pdfParamPosition , videoParamPosition );
2055+ userNameParamPosition );
20532056
20542057 }
20552058 }
0 commit comments